Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
That Bloke That Bloke is offline
external usenet poster
 
Posts: 2
Default Data Source Declaration

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


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Data Source Declaration

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
"That Bloke" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
That Bloke That Bloke is offline
external usenet poster
 
Posts: 2
Default Data Source Declaration

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.

"Peter Jamieson" wrote in message
...
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
"That Bloke" wrote in message
...
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





  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Data Source Declaration

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
"That Bloke" wrote in message
...
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.

"Peter Jamieson" wrote in message
...
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
"That Bloke" wrote in message
...
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







Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Trucated in word merge with excel source BAW Mailmerge 6 May 3rd 06 04:10 PM
How do I create a read-only mail merge data source? Julie Mailmerge 3 November 16th 05 07:23 PM
DotNet Data Table as Mail Merge Data Source goraya Mailmerge 1 July 7th 05 09:51 AM
Specific Email Merge w/ Specific Attachements Mark B Mailmerge 9 February 21st 05 05:10 AM
Cannot Find Its Data Source Dave Foote Mailmerge 3 December 17th 04 11:27 AM


All times are GMT +1. The time now is 06:32 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"