General information
Category:
Coding, syntax & commands
Hi Marcia.
I had alook at the Article but cannot get it to work.
I have tried various combinations, but am still getting an error message.
&& 10-05-04 From Word2002 onwards, uses different way of accessing data
&& See KB: 289830
&& Need additional parameter
This first one works fine on Word 2000
oWord.ActiveDocument.MailMerge.OpenDataSource;
(lcFilename, 0, .F., .F., .T., .F., "", "", .F., "", "", lcConnectionString, This.cSQL, "")
&& I cannot get any of the following to work:-
*!* oWord.ActiveDocument.MailMerge.OpenDataSource;
*!* (lcFilename, 0, .F., .F., .T., .F., "", "", .F., "", "", lcConnectionString, This.cSQL, "","wdMergeSubTypeWord2000")
*!* oWord.ActiveDocument.MailMerge.OpenDataSource;
*!* (lcFilename, 0, .F., .F., .T., .F., "", "", .F., "", "", lcConnectionString, This.cSQL,"wdMergeSubTypeWord2000")
*!* oWord.ActiveDocument.MailMerge.OpenDataSource;
*!* (lcFilename, 0, .F., .F., .T., .F., "", "", .F., "", "", lcConnectionString, This.cSQL,"",wdMergeSubTypeWord2000)
*!* oWord.ActiveDocument.MailMerge.OpenDataSource;
*!* (lcFilename, 0, .F., .F., .T., .F., "", "", .F., "", "", lcConnectionString, This.cSQL,"",8)
*!* oWord.ActiveDocument.MailMerge.OpenDataSource;
*!* (lcFilename, 0, .F., .F., .T., .F., "", "", .F., "", "", lcConnectionString, This.cSQL,"",,8)
oWord.ActiveDocument.MailMerge.OpenDataSource;
(lcFilename, 0, .F., .F., .T., .F., "", "", .F., "", "", lcConnectionString,This.cSQL,,,8)
I'm sure its probably down to the syntax
(Or if there is some other way of automating Word, I would use it)
regards,
Gerard
>Hi Gerard.
>
>Error is: Ole Idispatch exception code 0 from Microsoft Word
> Word was unable to open the data source.
>
>Seems to be coming from code :- ..... Mailmerge.OpendataSource(mySource)
>
>This one started with Word XP - it has to do with the change to ODSO to access data using OLEDB instead of DDE. There is an extra parameter you can send to th OpenDataSource() method to tell it to "SET BackwardCompatible ON" and use DDE to acces the data.
>
>The info is in the KB -
>
>PSS ID Number: 289830
>
>Article Last Modified on 9/17/2001
>
>
>--------------------------------------------------------------------------------
>The information in this article applies to:
>
>
>Microsoft Word 2002
>
>--------------------------------------------------------------------------------
>
>This article was previously published under Q289830
>SYMPTOMS
>When you call the OpenDataSource method to connect a mail merge document to a Microsoft Excel or Microsoft Access data source with Word 2002, the Select Table dialog box appears. The same code, when used with Word 97 or Word 2000, runs without displaying a dialog box.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only