Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combine n word documents to a new doc
Message
From
11/03/2010 07:45:16
 
 
To
11/03/2010 04:20:20
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Germany
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
MySQL
Miscellaneous
Thread ID:
01453867
Message ID:
01453888
Views:
68
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
Previous
Reply
Map
View

Click here to load this message in the networking platform