Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / September 2004

Tip: Looking for answers? Try searching our database.

Replace Sorce of data in MSWord merge document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MichaelK - 30 Sep 2004 00:05 GMT
I'm opening merge a Word document from Access.

I can keep the same Query as a source of data for fields in the document
and just replace the body of the query.

Is there a way to change the Query name as the source of data for merging on
the fly from the Access?  If so then how to do it in VBcode?

Thanks,
Michael.
david epsom dot com dot au - 30 Sep 2004 07:16 GMT
To change the body of a query:

application.querydefs("myquery").sql = "Select * from tbl"

You can also set the Word merge datasource before doing the merge.
You need to ask in a Word group to find how to do that.

(david)

> I'm opening merge a Word document from Access.
>
[quoted text clipped - 6 lines]
> Thanks,
> Michael.
MichaelK - 30 Sep 2004 17:29 GMT
Thanks David.
I know how to replace query sql.
May be I wasn't clear, I'm looking the way to replace datasource of the Word
document
on the fly while I'm in Access. Don't want to go in the word document and do
it manually.

Regards,
Michael

> To change the body of a query:
>
[quoted text clipped - 16 lines]
>> Thanks,
>> Michael.
John Nurick - 30 Sep 2004 20:47 GMT
Hi Michael,

I can't remember whether I've ever tried it, but AFAIK you need to
manipulate the Word document's MailMerge.DataSource object or
MailMerge.DataSource.Connect string.

>Thanks David.
>I know how to replace query sql.
[quoted text clipped - 26 lines]
>>> Thanks,
>>> Michael.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
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.