Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 5.0 and Word MailMerge
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
VFP 5.0 and Word MailMerge
Miscellaneous
Thread ID:
00102674
Message ID:
00102674
Views:
54
After a few problems I create a form in wich a User can create new and edit old word documents, saveing them in GENERAL field.
With VB for application I create a DataSource (Word Document) each time the user want to edit the main document.
The first time all is OK, but after that the DataSource is linked to the (Document 1) not to My document. What I'm doing wrong. Here is the code:

// Dogowor is OleBoundControl that is linked to the GENERAL field where I keep the documents

m_name = "c:\temp\Src_Doc"
IF FILE(m_name+".DOC")
mm_name = m_name + ".DOC"
DELETE FILE &mm_name
ENDIF

header_rec = "Field1;Field2;Field3"

LOCAL oWord
oWord = ThisForm.Dogowor.object
WITH oWord
WITH .MailMerge
.CreateDataSource(m_name,"","",header_rec,,"","","",.t.)
.EditDataSource
WITH .Application
.Selection.TypeText("test1")
.Selection.MoveRight(12) && One cell
.Selection.TypeText("Test2")
ENDWITH
ENDWITH
ENDWITH
thisForm.Dogowor.DoVerb(-2)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Reply
Map
View

Click here to load this message in the networking platform