Tony,
Thanks for the response. I am accessing an SQL Server 2000 The following is a Sub I was using to test if it was possible. I get an error if I use the "Update" statement in my SQL string.
Sub FindSubjects()
Dim varSubject As String
Selection.Find.ClearFormatting
With Selection.Find
.Text = "A?.?."
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchFuzzy = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
varSubject = Selection.Text
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:=Connection, _
Connection:= _
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=checklistitems;Data Source=is-18wg1;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=WS-18WGHQ-0076;Use Encryption for Data=False;Tag wi" _
, SQLStatement:="UPDATE ""cklsttestchecklist"" SET Subject = '" & varSubject & "'", SQLStatement1:="", _
SubType:=wdMergeSubTypeOther
End Sub
It does work to pull info using the following:
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Documents and Settings\emmett.wylam\My Documents\My Data Sources\is-18wg1 checklistitems.odc" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=checklistitems;Data Source=is-18wg1;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=WS-18WGHQ-0076;Use Encryption for Data=False;Tag wi" _
, SQLStatement:="SELECT * FROM ""cklsttestchecklist""", SQLStatement1:="", _
SubType:=wdMergeSubTypeOther
Your help is greatly appreciated.