Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Mail Merge
Message
 
To
23/04/2012 17:15:34
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows 7
Miscellaneous
Thread ID:
01542272
Message ID:
01542413
Views:
86
This message has been marked as the solution to the initial question of the thread.
>OK, we're making progress. With Dragan's help I got past the prior compile error. Now, I'm receiving:
>
>"OLE IDispatch exception code 0 from Microsoft Word: String is longer than 255 characters.."
>
>at: wdMergeSubTypeAccess) && SubType
>
>Any suggestions?
>
>As always, thank you so much!
#define wdMergeSubTypeAccess 1
#define wdOpenFormatAuto     0

lcFile = m.dir+"data\labels.xls"
lcConnection = [Provider=Microsoft.Jet.OLEDB.4.0;Data Source=]+m.lcFile+[;Extended Properties="HDR=Yes;IMEX=1";]

oWord.ActiveDocument.MailMerge.OpenDataSource(m.lcFile,;                && Name
                                             wdOpenFormatAuto,;         && Format
                                             .f.,;                      && ConfirmConversions
                                             .f.,;                      && ReadOnly
                                             .t.,;                      && LinkToSource
                                             .f.,;                      && AddToRecentFiles
                                             "",;                       && PasswordDocument
                                             "",;                       && PasswordTemplate
                                             .f.,;                      && Revert
                                             "",;                       && WritePasswordDocument
                                             "",;                       && WritePasswordTemplate
                                             m.lcConnection,;           && Connection
                                             "SELECT * FROM `Sheet1$`",; &&SQLStatement
                                              "",;                       &&SQLStatement1
                                              .f.,;                      && OpenExclusive
                                               wdMergeSubTypeAccess)     && SubType
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform