Error 48 Unable to load DLL

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top