Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2005

Tip: Looking for answers? Try searching our database.

Problem with Word Code in 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Neil - 18 Aug 2005 17:00 GMT
I am performing a mail merge in Word through an Access database. As part of
the process, I check to see if a Word document is already a mail merge
document, and then, if it is, if it has the correct data source. Thus, from
within Access, I use:

If objWord.ActiveDocument.MailMerge.State=wdMainAndDataSource Then
...

This has worked fine with Access/Word 2000, or if the program is used with
Access/Word 2002. However, with Access/Word 2003, the MailMerge.State value
returns wdNormalDocument (0) instead of wdMainAndDataSource (2). I
double-checked the document, and it clearly is a mail merge main document
with a data source. When when read through Access, I get the return value of
a normal document.

Any ideas as to what's going on?

Thanks,

Neil
Cindy M  -WordMVP- - 19 Aug 2005 10:31 GMT
Hi Neil,

> This has worked fine with Access/Word 2000, or if the program is used with
> Access/Word 2002. However, with Access/Word 2003, the MailMerge.State value
> returns wdNormalDocument (0) instead of wdMainAndDataSource (2).

See this article

"Opening This Will Run the Following SQL Command" Message When You Open a Word
Document - 825765
http://support.microsoft.com?kbid=825765

When you automate opening a Word main merge document, the link to the data
source is cut off without warning you. You either have to use .OpenDataSource
after opening the document, or make sure the Registry key is set to disable
the security question.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Neil - 19 Aug 2005 10:52 GMT
Thanks, Cindy. That addresses the issue.

Neil

> Hi Neil,
>
[quoted text clipped - 25 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
Cindy M  -WordMVP- - 19 Aug 2005 10:31 GMT
Replied to this duplicate question in one of the
office.devloper newsgroups.

   Cindy Meister

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.