Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation - avoiding 2 copies of Word
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Word Automation - avoiding 2 copies of Word
Miscellaneous
Thread ID:
00748221
Message ID:
00748221
Views:
43
I made my first attempt at starting word from VFP7, works fine except if the code [following] is started twice from the button on the form, I get two copies of Word starting, not a second document window within Word. I got the code from a web site, and don't have time right now to understand what I am doing, just need to get a demo up by tomorrow.

Also I just want to stick stuff at the end of the text, then let the user modify and save the document - that works, but I end up with all the text highlighted.

#DEFINE wdStory 6
loWord = CREATEOBJECT("Word.Application")
loWord.Visible = .T.
loDocument = loWord.Documents.Add("template/dot name")
loSelection = loWord.Selection
loSelection.MoveEnd(wdStory)
* repeat following as required
loSelection.InsertAfter(---some text----)
loSelection.InsertAfter(CHR(13))
Next
Reply
Map
View

Click here to load this message in the networking platform