Home > Archive > FoxPro Help and Support > October 2005 > combine 2 word file to 1 word file ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author combine 2 word file to 1 word file ?
Izzue

2005-10-27, 8:34 am

Hi

I using VFP 6.0
I have a vfp code to export dbf data to word file

My question is how can use VFP code to combine 2 word file to 1 word
file ?

Thanks for help!



********************
********************
********************
****************
LOCAL oWordObj

* Open a Word Object
oWordObj = CREATEOBJECT("WORD.application")

* Next open the original document in a second window
oWordObj.Documents. Open(SYS(5)+CURDIR()
+"\WORD\ADMIN.DOC")

* Retrieve the number of bookmarks defined in DOC
pnCountMarks = oWordObj.ActiveDocument.Bookmarks.Count

* Store bookmarks in an array
DIMENSION aMark[pnCountMarks]

FOR pnCount = 1 TO pnCountMarks
aMark[pnCount] = oWordObj.ActiveDocument.Bookmarks(pnCount).Name
ENDFOR

* Loop through all the bookmarks in the document
FOR pnCount = 1 TO pnCountMarks
pcMarkName = UPPER(aMark[pnCount])

* Move to the next bookmark
WITH oWordObj.ActiveDocument. Bookmarks(pcMarkName
).Range
DO CASE
********************
********************
********************
****************


Cindy Winegarden

2005-10-27, 8:34 am

Hi Teddy,

I'm a little confused what you're trying to do and what the code represents.
Are you just trying to add text from one document onto the end of another,
or are you trying to insert text from one document into the other at certain
bookmark points?

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn
.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden


"Izzue" <teddy1218@hongkong.comSPAM> wrote in message
news:Ot%23PEGXzFHA.3836@TK2MSFTNGP10.phx.gbl...
> Hi
>
> I using VFP 6.0
> I have a vfp code to export dbf data to word file
>
> My question is how can use VFP code to combine 2 word file to 1 word
> file ?
>
> Thanks for help!
>
>
>
> ********************
********************
********************
****************
> LOCAL oWordObj
>
> * Open a Word Object
> oWordObj = CREATEOBJECT("WORD.application")
>
> * Next open the original document in a second window
> oWordObj.Documents. Open(SYS(5)+CURDIR()
+"\WORD\ADMIN.DOC")
>
> * Retrieve the number of bookmarks defined in DOC
> pnCountMarks = oWordObj.ActiveDocument.Bookmarks.Count
>
> * Store bookmarks in an array
> DIMENSION aMark[pnCountMarks]
>
> FOR pnCount = 1 TO pnCountMarks
> aMark[pnCount] = oWordObj.ActiveDocument.Bookmarks(pnCount).Name
> ENDFOR
>
> * Loop through all the bookmarks in the document
> FOR pnCount = 1 TO pnCountMarks
> pcMarkName = UPPER(aMark[pnCount])
>
> * Move to the next bookmark
> WITH oWordObj.ActiveDocument. Bookmarks(pcMarkName
).Range
> DO CASE
> ********************
********************
********************
****************
>



Izzue

2005-10-27, 8:34 am

Hello Cindy

I have 2 template word document one is "cover letter document" another is
"description document"

my question is i need to export dbf data to 2 document,
"description document" need to export 1 or more times, but "cover letter
document" only export one time

therefore i want to combine all word document to one file.

what can i do ?

thanks a lot
Teddy




"Cindy Winegarden" < cindy_winegarden@msn
.com> 撰寫於郵件新聞:%230n
GioozFHA.3780@TK2MSFTNGP12.phx.gbl...
> Hi Teddy,
>
> I'm a little confused what you're trying to do and what the code
> represents. Are you just trying to add text from one document onto the end
> of another, or are you trying to insert text from one document into the
> other at certain bookmark points?
>
> --
> Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
> cindy_winegarden@msn
.com www.cindywinegarden.com
> Blog: http://spaces.msn.com/members/cindywinegarden
>
>
> "Izzue" <teddy1218@hongkong.comSPAM> wrote in message
> news:Ot%23PEGXzFHA.3836@TK2MSFTNGP10.phx.gbl...
>
>



Dan Freeman

2005-10-27, 8:34 am

I still can't tell what you're trying to do. Part of the problem is you're
using words you've made up describe what you're doing, and some of them
already have meaning.

"Export" is a very specific action (in fact it's a Foxpro command), and has
nothing to do with Word.

Are you talking about mailmerge? Is the whole process description moot
because all you want to do is combine two documents? (If the latter, use
automation with copy/paste.)

Dan

Izzue wrote:[color=darkred
]
> Hello Cindy
>
> I have 2 template word document one is "cover letter document"
> another is "description document"
>
> my question is i need to export dbf data to 2 document,
> "description document" need to export 1 or more times, but "cover
> letter
> document" only export one time
>
> therefore i want to combine all word document to one file.
>
> what can i do ?
>
> thanks a lot
> Teddy
>
>
>
>
> "Cindy Winegarden" < cindy_winegarden@msn
.com>
> 撰寫於郵件新聞:%230n
GioozFHA.3780@TK2MSFTNGP12.phx.gbl...
********************
********************
********************
****************[col
or=darkred]
********************
********************
********************
****************


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com