Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Merge Fields Problems
Message
From
06/08/2004 18:43:23
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00856039
Message ID:
00931471
Views:
24
sounds strange

Just a mention, I have a book from Hentzenwereke that really was useful when working with these types of things. If you don't have this, it is worth picking up...

Microsoft Office Automation with Visual Foxpro - Granor/Martin

Very good book.


It sounds like you are on your way to a solution possibly... Good luck with this.

>Stacy
>
>Now my problem is not to open a datasource.
>
>I'm able to open 3 kind of datasources : Excel, DBF and .OCD (Office Database Connection used to wrap à ODBC Foxpro files).
>
>My actual trouble (the same that in January) is when I put some merge fields in the header or the footer.
>
>In "design time" in Word, all is OK but programatically from Visual FoxPro 7/8 it does not work.
>
>I can see all the merge fields in the body of the Word (XP and 2003) document but not in the header and / or the footer.
>
>This morning, I discover a very strange thing.
>If I put the same string (i.e "HELLO") in the body, header and footer and I use the function "Replace" to replace "HELLO" by "OLLEH" : It works fine.
>
>If I create a macro to do the same thing, it works only in the body.
>
>I will invertigate in this way because I think that all my troubles come from here.
>
>I everybody
>
>>Copy this code to a prg and run... Syntax seems to work for me under Word 2000,XP and 2003.
>>
>>
>>oword=crea('word.application')
>>oword.visible=.t.
>>oword.documents.open('C:\MYFILE.doc')
>>oword.APPLICATION.activedocument.mailmerge.OpenDataSource('c:\MYFILE.xls',,,.T.,,,,,,,,"Entire Spreadsheet")
>>
>>
>>
>>Another thing I am doing is having a template document file already created on the customer machine. If c:\myfile.doc does not exist, my program just copies the template doc to the new document name before this code runs...
>>Then, the code will open the datasource specified using a pre-built 'word-merge' document.
Thanks,

Stacy



Black Mountain Software, Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform