Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
35
Task/OLE-automation/FreeBASIC/ole-automation.basic
Normal file
35
Task/OLE-automation/FreeBASIC/ole-automation.basic
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#include "disphelper/disphelper.bi"
|
||||
|
||||
dhInitialize(True)
|
||||
dhToggleExceptions(True)
|
||||
|
||||
Dim As IDispatch Ptr wordApp, document, content
|
||||
Dim As IDispatch Ptr paragraphs, paragraph, rnge
|
||||
|
||||
OleInitialize(NULL)
|
||||
dhCreateObject("Word.Application", NULL, @wordApp)
|
||||
dhPutValue(wordApp, ".Visible = %b", True)
|
||||
dhGetValue("%o", @documents, wordApp, ".Documents")
|
||||
dhCallMethod(documents, "Add", @document)
|
||||
dhGetValue("%o", @content, document, ".Content")
|
||||
dhGetValue("%o", @paragraphs, content, ".Paragraphs")
|
||||
dhCallMethod(paragraphs, "Add", @paragraph)
|
||||
dhGetValue("%o", @rnge, paragraph, ".Range")
|
||||
dhPutValue(rnge, ".Text = %s", "This is a Rosetta Code test document.")
|
||||
|
||||
Sleep 10000 ' Wait 10 seconds
|
||||
|
||||
dhPutValue(document, ".Saved = %b", True)
|
||||
dhCallMethod(document, "Close(%b)", False)
|
||||
dhCallMethod(wordApp, "Quit")
|
||||
|
||||
SAFE_RELEASE(wordApp)
|
||||
SAFE_RELEASE(documents)
|
||||
SAFE_RELEASE(document)
|
||||
SAFE_RELEASE(content)
|
||||
SAFE_RELEASE(paragraphs)
|
||||
SAFE_RELEASE(paragraph)
|
||||
SAFE_RELEASE(rnge)
|
||||
|
||||
OleUninitialize()
|
||||
dhUninitialize(True)
|
||||
Loading…
Add table
Add a link
Reference in a new issue