Code: Select all
oWord := ComObjCreate("Word.Application")
oWord.Visible := False
oWord.Documents.Open(Path)
What is the code? I tried oWord.Documents.Close(Path) and .quit but it did not work
Code: Select all
oWord := ComObjCreate("Word.Application")
oWord.Visible := False
oWord.Documents.Open(Path)
Code: Select all
oWord := ComObjCreate("Word.Application")
oWord.Visible := False
oWord.Documents.Open(Path)
; .... other Code
oWord.quit()
Thank you SIRSir Teddy the First wrote: ↑06 Oct 2019, 10:38Hi,
as .quit() is a function it needs parentheses. This should work:
Code: Select all
oWord := ComObjCreate("Word.Application") oWord.Visible := False oWord.Documents.Open(Path) ; .... other Code oWord.quit()
Code: Select all
path := "C:\Users\xxx\test.docx"
oWord := ComObjCreate("Word.Application") ; create MS Word object
oFile := oWord.Documents.Open(path) ; create new document
;....
oFile.Close ; close the file
oFile := "" ; release the reference
oWord.Quit() ; close the application
oWord := "" ; release the reference
Users browsing this forum: No registered users and 35 guests