Information générale
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Network:
Windows 2003 Server
It appears that in versions 10 and 11, the OpenDataSource command is no longer necessary and it results in a dialog asking the user's permission to run the query on the data source (a real pain when printing lots of letters). Anyway, I check the version of Word and execute that command as necessary.
Actually, it is still necessary. What you are describing here is an entirely different issue
and is explained in the KB:
PSS ID Number: 279462
Article Last Modified on 10/29/2003
--------------------------------------------------------------------------------
The information in this article applies to:
Microsoft Word 2002
--------------------------------------------------------------------------------
This article was previously published under Q279462
SYMPTOMS
When you call the OpenDataSource method while automating Word 2002, the Select Data Source dialog box appears. If Word is not visible, it may appear to have stopped responding.
CAUSE
When you call OpenDataSource, the Select Data Source dialog box typically appears if you have not provided enough information to connect to the data source. By default, Word 2002 attempts to connect to the data source by using the Office DataSource Object (ODSO). ODSO requires the complete path and file name to either a database or an Office DataSource Connection (.odc) file for the Name argument. If you provide the Name argument with an empty string, the Select Data Source dialog box appears.
RESOLUTION
To avoid the dialog box to select a data source, do one of the following:
Supply the Name argument of OpenDataSource with the full path to a file-based database, such as a Microsoft Access database, a Microsoft Excel workbook, or a text file.
Supply the Name argument of OpenDataSource with the full path to an .odc file.
Supply the SubType argument of OpenDataSource with wdMergeSubTypeWord2000 to emulate Word 2000 behavior.
It seems you're implying that the bookmarking technique is a replacement for the mailmerge. I wouldn't think of bookmarks for mailmerges, but I'm not doing a ton of mailmerging, so I wouldn't call myself an expert on this. Maybe you could fill me in on this technique in more detail?
If you can wait untilk either later in the day or tomorrow. I am up to my eyeballs right now and the explanation could get lengthy < s >.
And no, I am not saying that it is a substitute for mailmerge. It is just a different technique that works better in some situations.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement