Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combine n word documents to a new doc
Message
De
11/03/2010 07:45:16
 
 
À
11/03/2010 04:20:20
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
MySQL
Divers
Thread ID:
01453867
Message ID:
01453888
Vues:
69
This message has been marked as the solution to the initial question of the thread.
>Hello Everybody
>
>I want to combine n smaller word documents to a new big word document via programm.(VFP9.2,Word 2003)
>open word
>add or insert or ??? 1.doc,2.doc,3.doc
>save as new.doc
>close word
>

Try something like this (untested):
LOCAL oWord, oDoc, oRange

oWord = CREATEOBJECT("Word.Application")
oDoc = oWord.Documents.Open("1.doc") && you'll need complete path

oRange = oDoc.Range()
oRange.Collapse(0)

* For each of the other documents
oRange.InsertFile("2.doc") && again, complete path
oRange.Collapse(0)

* After add all the other docs
oDoc.SaveAs("new.doc") && with complete path

oWord.Quit()
Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform