View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Change sourcepath to Access query without using wizard - 2007

There's nothing like that built-in (other than the standard Mailing tab
options). The simplest approach is likely to be to use VBA to issue an
OpenDataSource - in this case, if you are conecting using the default
method (OLE DB - you usually have to make a positive effort to connect
using anything else so you'd probably know if you had used DDE or ODBC)
you could probably get away with
a. make a backup coy of your document
b. open the VBA Editor
c. Insert-Module
c. copy this into the module, put the appropriate file/query/table
name in, and run it:

Sub setmmds()
ActiveDocument.MailMerge.OpenDataSource _
Name:="the full pathname of the database", _
SQLStatement:="SELECT * FROM the_name_of_the_table_or_query"
End Sub

It's not guaranteed to work, and I suspect the steps involved in going
through the normal process may be fewer overall anyway.


Peter Jamieson

http://tips.pjmsn.me.uk

On 20/11/2009 10:24, Tor Michal wrote:
Hi

The source path has changed a little bit, and it would be fantastic to
be able to edit it manually as a textstring instead of using the
wizard (which takes me through all the steps from source file to
selected query - so boring!).

Anyone aware of any "hidden" feature that lets me edit the sourcepath
as text?

If you don't know, have a nice life anyway

--
All the best to everyone
Tor Michal