S
Shannon Rotz
I had an Access 97/2000 app. which was doing some Word automation, using the
following code, and worked fine:
With myMerge
.MainDocumentType = wdFormLetters
.OpenDataSource Name:=currentdb.Name, _
LinkToSource:=True, _
AddToRecentFiles:=False, _
Connection:="Query " & sQueryName
End With
However, this did not work in XP. So I took a look at the Knowledge Base,
and discovered that the default connection had changed from DDE to OLEDB.
Based on the results of that article, I changed the code to this:
With myMerge
.MainDocumentType = wdFormLetters
.OpenDataSource Name:=currentdb.Name, _
AddToRecentFiles:=False, _
sqlstatement:=SqlStmt
End With
where SQLStmt = "Select * from [Query]"
However, this does not work either - I keep getting a "Confirm Data Source"
dialog box. My help files are stubbornly continuing to give me Office 2000
help (I have Office 2000 installed as well), which of course is no use in
this situation.
Can anyone suggest an alternate way to link Word to a query before I tear
out all of my hair?
Shannon
following code, and worked fine:
With myMerge
.MainDocumentType = wdFormLetters
.OpenDataSource Name:=currentdb.Name, _
LinkToSource:=True, _
AddToRecentFiles:=False, _
Connection:="Query " & sQueryName
End With
However, this did not work in XP. So I took a look at the Knowledge Base,
and discovered that the default connection had changed from DDE to OLEDB.
Based on the results of that article, I changed the code to this:
With myMerge
.MainDocumentType = wdFormLetters
.OpenDataSource Name:=currentdb.Name, _
AddToRecentFiles:=False, _
sqlstatement:=SqlStmt
End With
where SQLStmt = "Select * from [Query]"
However, this does not work either - I keep getting a "Confirm Data Source"
dialog box. My help files are stubbornly continuing to give me Office 2000
help (I have Office 2000 installed as well), which of course is no use in
this situation.
Can anyone suggest an alternate way to link Word to a query before I tear
out all of my hair?
Shannon