Problems transferring a database from access2000 to access2003
Hi
I have a database that was set up using Office 2000 and running
on windows 98SE. I have now upgraded the machine and now running Windows XP and Office 2003.
I have transferred the database to the new machine and all works fine until I try and do a mailmerge using the following code.
The error I get back is Error”432” and running the debug points to the code Set objWord = GetObject("C:\Church Documents\" & strDocName)
Anybody with suggestions
Hi
I have a database that was set up using Office 2000 and running
on windows 98SE. I have now upgraded the machine and now running Windows XP and Office 2003.
I have transferred the database to the new machine and all works fine until I try and do a mailmerge using the following code.
Code:
Function MergeIt()
Dim objWord As Word.Document
Dim strDocName As String
Dim intResponse As Integer
strDocName = InputBox("Enter Name of Word Document to be merged to." & vbCrLf _
& "Note: You should write the document first and save it in c:\church documents." _
& vbCrLf & "You can save the resulting document to any location", _
"Mail Merge Document Title", "Mail Merge Document.doc")
Set objWord = GetObject("C:\Church Documents\" & strDocName)
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:="C:\Church Documents\Database\Temp Data.mdb", _
LinkToSource:=True, _
Connection:="TABLE tblMailMerge", _
SQLStatement:="Select * from [tblMailMerge]"
' Execute the mail merge.
'intResponse = MsgBox("Click OK to produce the document if you have already written it" _
' & vbCrLf & _
' "Otherwise click CANCEL, switch to Word and Merge the fields in when you're ready.", _
' vbOKCancel + vbExclamation, "Mail Merge")
'
'If intResponse = vbOK Then
' objWord.MailMerge.Execute
'End If
End Function
The error I get back is Error”432” and running the debug points to the code Set objWord = GetObject("C:\Church Documents\" & strDocName)
Anybody with suggestions
Last edited by a moderator: