Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word automation to unlimited number of items
Message
From
13/06/2002 12:08:10
 
 
To
13/06/2002 08:06:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00667775
Message ID:
00668018
Views:
17
>Create a mailmerge template with 2 (or 3?) fields and make them in whatever layout you want. ie:
>
>
>#Define MYDBC fullpath("testdata.DBC")
>#Define wdSendToEmail  2
>#Define wdSendToFax  3
>#Define wdSendToNewDocument  0
>#Define wdSendToPrinter  1
>cSQLStatement1 = "SELECT * FROM employee where title like [Sales%]"
>cSQLStatement2 = ""
>
>* Be carefull with where clause - where title = [Sales] fails
>* for ODBC uses ANSI SQL (exact match)
>* Two strings for first is limited to 255 chars
>
>oWordDocument=createobject("word.application")	&& Create word object
>With oWordDocument
>  .Documents.Add(sys(5)+curdir()+'mytemplate.dot') && Use a predefined template
>  With .ActiveDocument.MailMerge
>    .OpenDataSource(,,,.T.,,,,,,,, ;
>      "DSN=Visual FoxPro Database;SourceDB="+MYDBC+;
>      ";SourceType=DBC;Exclusive=No;",;
>      cSQLStatement1, cSQLStatement2) && Open data source - Link to source
>    .Destination = wdSendToNewDocument
>    .Execute
>  Endwith
>  .Visible = .t.
>Endwith
>
I just need to understand how will the store will be done in regards to two fields for example.

>Alternatively (I think this one easier for you:) create an HTML file and open that in word.

I've been thinking about that but only Word will take care of the 3 columns format I need with exact page breaks where needed.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform