Re: Pass MailMerge.CreateDataSource to document from Access
- From: "richardb" <richardb@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 5 Jan 2006 05:10:03 -0800
Cindy,
Running a macro in my Word 2003 environment showed the script I will use.
However, it created a first line, which was
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
Do I need this prior to my "objWord.MailMerge.CreateDataSource, etc."?
Otherwise I will try this in a little while and let you know. Thank you.
"Cindy M -WordMVP-" wrote:
> Hi =?Utf-8?B?cmljaGFyZGI=?=,
>
> > I create a query in Access and then use "GetObject", etc. to Activate a Word
> > document and then runautomacro, which contains the code to run the document
> > with mailmerge back to my Access query as the data source. I could use some
> > help with a complete example of "objWord.MailMerge.CreateDataSource", where
> > the data source is my Access query.
> >
> > Another important question: In a multi-user environment, can more than one
> > Access user activate the same Word Document, pass a [unique] data source (a
> > query) and each one run their job at the same time?
> >
> A note on this point: the answer would be no. But you could (and should, even
> with the new scenario) set up a TEMPLATE. Your automation code then uses Set
> doc = wdobj.Documents.Add("TemplatePathAndName") to create the new merge
> document from the template.
>
> It's difficult to give you any specific help with the syntax for OpenDataSource
> because it can vary so widely depending on Word version, and which connection
> method is used. The best way to get a handle on this is to
>
> 1. Test the available connection methods for the Office version involved. (Tell
> me which you have, and I'll tell you how to do this)
>
> 2. Record making the connection in a macro in Word. You can this port this to
> your Access VBA code.
>
> 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 :-)
>
>
.
- References:
- Re: Pass MailMerge.CreateDataSource to document from Access
- From: Cindy M -WordMVP-
- Re: Pass MailMerge.CreateDataSource to document from Access
- Prev by Date: Re: Automation to set duplex works on HP but not Dell printer
- Next by Date: MS-Access 97/2003 System Administration - Help
- Previous by thread: Re: Pass MailMerge.CreateDataSource to document from Access
- Next by thread: Re: Pass MailMerge.CreateDataSource to document from Access
- Index(es):
Relevant Pages
|