Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email code works for Outlook 2000 but not 98?

Status
Not open for further replies.

ckennerdale

Programmer
Dec 23, 2000
158
GB
I have some code which generates an email. As it is using DoCmd.SendObject I thought it just fired up your default email client, and didnt need to load up any module or library.

It works fine on my Outlook 2000, but when trying on a colleagues Office 98 (it needs to run on both machines) i get the following message

"Cant find priject or library"


here is my code

Private Sub Send_Email_Button_Click()
' Prevent error screen if user cancels without sending mail.
On Error Resume Next

Dim strToWhom As String '<---sets up a variable object for who we are going to send out email to
Dim strMsgTitle As String '<---sets up a variable object for the title of the email
Dim strMsgBody As String '<---sets up a variable object for the body of our email

strToWhom = Me!Email
strMsgTitle = &quot;Job Number IR&quot; & Me!ID & &quot; &quot; & Me!JobName
strMsgBody = &quot;Dear &quot; & Me!Name & Chr(13)
strMsgBody = strMsgBody & &quot;Re Job Number IR&quot; & Me!ID & Chr(13)
strMsgBody = strMsgBody & Me!JobName & Chr(13) & Chr(13)
strMsgBody = strMsgBody & &quot;Please find attached the appropriate files.&quot; & Chr(13) & Chr(13)
strMsgBody = strMsgBody & &quot;If you have an questions please do not hesitate to contact me.&quot; & Chr(13) & Chr(13)
strMsgBody = strMsgBody & &quot;Thanks&quot; & Chr(13)
strMsgBody = strMsgBody & &quot;Corporate Policy Team&quot;

' Provide Subject title bar and message text.
DoCmd.SendObject , , , strToWhom, , , strMsgTitle, strMsgBody, True

End Sub


Thanks in advance

Caspar Kennerdale
 
The problem may be that when you developed the application in A2K the outlook reference is for Office 2K. That reference did not exist in the earlier versions, so you have to go to any module, click on Tools, References and uncheck the one that says MISSING and select the correct MS Outlook library.

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Thanks

It was actually an Office 9.0 library that wasnt loading, and wasnt actually required for anything

Caspar Kennerdale
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top