|
Subject:
|
missing DLL error (48)
|
|
Posted By:
|
Loralee
|
Post Date:
|
12/18/2005 2:39:05 PM
|
Could anyone shed some light, or suggest what else to try?
I have a new .mdb which uses MailMerge to create form letters. The mdb runs FINE and Word and Mail Merge launch fine, with the record limited to the correct one on my home development machine. HOWEVER, when I move the file to a server at work MailMerge fails with "Error #48, missing DLL". I really want to get it to work on my machine at work and my co-workers machine as well. It would give us so much flexibility, not to mention all the work and frustration that went into the adventure...(Work machines are now running XP Pro, with Office 2K. Install did not work when machine had Windows 2000).
MDB runs FINE on 3 other machines which are running either XP-Pro or XP-Home as OS and Office 2K. (2 of the machines have Office Development licenses, the third has just plain Office and a new version of Visual Studio is installed as well. ) I used Package and Deploy to create an installation package as I used a few ActiveX controls in the MDB. The ActiveX Controls are working okay.....)
Code errors out at the GetObject call........and of course Word hasn't yet opened.
Thanks,
Loralee ********************************************* Private Sub cmdMergeLetter_Click() ' this is an attempt to open a Word document and start a mail merge Dim strFilePath As String Dim objWord As Word.Document Dim strPatientID As String ' use to link to patient Dim strSELECT As String Dim strFROM As String Dim strWHERE As String Dim strSQLMerge As String
strPatientID = Forms!frmpatientdata.txtPatientID strSELECT = "SELECT tblPatient.[PatientID], tblPatient.[PtFirstName], tblPatient.[PtLastName], tblPatient.[PtBD], tblCity.[City], tblPatient.[PtAddress], tblPatient.[PtZip], tblReferral.[ReferBy]" strFROM = " FROM (tblCity INNER JOIN tblPatient ON tblCity.[CityID] = tblPatient.[PtCityFK]) INNER JOIN tblReferral ON tblPatient.[PatientID] = tblReferral.[PtFK]" strWHERE = " WHERE ((([PatientID])= " & strPatientID & "))" strSQLMerge = strSELECT & strFROM & strWHERE
CurrentDb.QueryDefs("qrymailmerge").SQL = strSQLMerge
'CurrentDb.QueryDefs("qrymailmerge").filter = "[patientid] = strpatientid" Me.cmdlg.DialogTitle = "Choose File Name and Location" Me.cmdlg.ShowOpen strFilePath = Me.cmdlg.FileName
Set objWord = GetObject(strFilePath, "Word.document") ' ERRORS OUT HERE (#48)
' make word visible objWord.Application.Visible = True
'objWord.MailMerge.OpenDataSource _ 'Name:="C:\Documents and Settings\Name\My Documents\Provider Management Database" & _ '"\Provider Management.mdb", _ ' LinkToSource:=True, _ ' Connection:="QUERY qrymailmerge" ' , _ ' SQLStatement:="SELECT * FROM tblPatient"
' execute the mail merge objWord.MailMerge.Execute objWord.Close
End Sub ***************************************
|
|