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 / July 2006

Tip: Looking for answers? Try searching our database.

Data Source Declaration

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
That Bloke - 28 Jul 2006 20:18 GMT
Is it possible to identify the path to the datasource in a Word template?
The data is always in the same place, it's just several users put their
templates all over the place on the server and I can't be arsed to edit the
templates on a per user basis.

Thanks,

Pete
Peter Jamieson - 28 Jul 2006 22:42 GMT
Only after you open them in Word.

You could open them all programmatically one by one, examine
ActiveDocument.MailMerge.DataSource.Name, (and for future reference you
might find it useful to record the following as well)
ActiveDocument.MailMerge.DataSource.ConnectString
ActiveDocument.MailMerge.DataSource.QueryString
ActiveDocument.MailMerge.DataSource.Type (just in case)

Then for each one whose datasource needs to change (I don't know how you
would work that out), issue:

ActiveDocument.Mailmerge.DataSource.Close

then issue the OpenDataSource you really want.

Trouble is that if the datasource is not where the template expects you
probably won't get as far as opening the template.

Peter Jamieson
> Is it possible to identify the path to the datasource in a Word template?
> The data is always in the same place, it's just several users put their
[quoted text clipped - 4 lines]
>
> Pete
That Bloke - 28 Jul 2006 23:44 GMT
Thanks for the info, Peter.  The data will always be in the same place and
everyone uses the same source.  It's just I have no control where people put
their templates.

> Only after you open them in Word.
>
[quoted text clipped - 24 lines]
>>
>> Pete
Peter Jamieson - 29 Jul 2006 14:58 GMT
The templates are always pointing to the same data source and the data
source is not being set up by a macro, they should all have the same path
embedded in them, barring anomalies suchas use of mapped network drive
letters, and UNC pathnames. I don't think they will ever have relative path
names but I wouldn't rule it out. Not sure if that helps you but there you
go.

Peter Jamieson
> Thanks for the info, Peter.  The data will always be in the same place and
> everyone uses the same source.  It's just I have no control where people
[quoted text clipped - 28 lines]
>>>
>>> Pete
 
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.