Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View 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)