Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Automation Documentation
Message
De
29/06/2000 09:00:39
Alec Dearden
Peterborough Hospitals Nhs Trust
Peterborough, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00384576
Message ID:
00386376
Vues:
38
Paul,

I do something very similar to what you want.
I have a system that creates Word documents, replaces bookmarks with data
then allows the user to carry on from that point.

The important bits of code are:-

oWord=createobject("word.application") && new instance of Word
oWord.documents.open(docFileName) && create document

** Table has a list of valid bookmark names in field bookmark
use locBmark in 0
select locBmark

** Replace Bookmarks
do while not eof()
scatter memvar

if oWord.activedocument.bookmarks.exists(alltrim(m.bookmark))
and not empty(m.data)
xphrase="oWord.activedocument.bookmarks
(alltrimm.bookmark)).range.text="+m.data
&xphrase
endif
skip
enddo
use



oWord.activedocument.save && Save Document
oWord.visible=.t. && Show Word Window
oWord.ActiveWindow.View.Type = 3 && Page Layout View
oWord.WindowState = 1 && Maximise Word Window
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform