R
Rosa
I am a good user of Word, but not a programmer, and am struggling wit
my first VBA project (HELP!).
I am setting up a template, which will be stored centrally on a server
Users at 2 locations need to be able to use the template, which is se
up as a main document, to be merged with data from an SQL View, throug
an ODC file stored locally. Users at location 1, store their ODC fil
in the standard folder:
C:\Documents and Settings\User_Name\My Documents\My Data Sources
However, users at location 2 have their My Documents folder setup b
their administrators to a different location, so that their ODC file i
in folder:
D:\Data\User_Name\My Documents\My Data Sources
For the first set of users I have been running the merge in VBA:
ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument
ActiveDocument.MailMerge.OpenDataSource name:= _
"C:\Documents and Settings\" & GetUserName & "\My Documents\M
Data Sources\connection.odc" _
This works fine, as I have found a routine which returns the user name
but is there a way I can capture the PC default location for My Dat
Sources? I have found information on capturing the document fil
location (using wdDialogToolsOptionsFileLocations), however, what if
user sets a different default document file location?
I'd be grateful for any suggestions on how I can solve this issue
my first VBA project (HELP!).
I am setting up a template, which will be stored centrally on a server
Users at 2 locations need to be able to use the template, which is se
up as a main document, to be merged with data from an SQL View, throug
an ODC file stored locally. Users at location 1, store their ODC fil
in the standard folder:
C:\Documents and Settings\User_Name\My Documents\My Data Sources
However, users at location 2 have their My Documents folder setup b
their administrators to a different location, so that their ODC file i
in folder:
D:\Data\User_Name\My Documents\My Data Sources
For the first set of users I have been running the merge in VBA:
ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument
ActiveDocument.MailMerge.OpenDataSource name:= _
"C:\Documents and Settings\" & GetUserName & "\My Documents\M
Data Sources\connection.odc" _
This works fine, as I have found a routine which returns the user name
but is there a way I can capture the PC default location for My Dat
Sources? I have found information on capturing the document fil
location (using wdDialogToolsOptionsFileLocations), however, what if
user sets a different default document file location?
I'd be grateful for any suggestions on how I can solve this issue