Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word Automation - avoiding 2 copies of Word
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))
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement