Error 48 Unable to load DLL

  • Thread starter Thread starter Jim Rogers
  • Start date Start date
J

Jim Rogers

VB6

I'm running Windows 2000 and Outlook 2002


I have some simple test code which runs ok on
machines with Windows 2000 and Outlook 2000 but not on my
version as mentioned above. I've tried using.
Outlook 2002 "Microsoft Outlook 10.0 Object Library"
msoutl.olb and "Microsoft Outlook 9.0 Object Library"
neither work

sample code..........
----------------------------------
Private Sub Command1_Click()

Dim objOutlook As New Outlook.Application
Dim objMail As MailItem

Set objOutlook = CreateObject("outlook.application")
Set objMail = objOutlook.CreateItem(olMailItem)

With objMail
.To = "email address"
.Subject = "Test"
.Body = "Test Mail"
.Send
End With

Set objMail = Nothing
Set objOutlook = Nothing

End Sub
 
Always develop on a machine with the oldest version of Outlook you
want to support. Just set a project reference to Outlook and don't
specify any versions in your declarations: Dim oApp As
Outlook.Application and so on. It should work.

Never use New and CreateObject on the same object. Lose the New in
your declaration.
 
Back
Top