Logon Method in Outlook 2002

P

Paul

I have Outlook 2002. My E-mail Server is Microsoft
Exchange 2000. Now, I am running this VBA code in a module
in Excel 2002. Now, from my understanding this code is
suppose to automatically start Outlook, log into Exchange,
and Send my E-mail. However, I am always prompted for my E-
mail password, which I don't want to happen. What am I
doing wrong? How can I correct this problem? I must be
missing something. Any information would be great.
Thank You
Paul

Sub AutoLogon()
Dim OL As Object
Dim MailItem As Object
Set OL = CreateObject("Outlook.Application")
Set MailItem = OL.CreateItem(olMailItem)

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
myNameSpace.Logon "Profile Name", "Password", False, True

MailItem.To = "Pspeziali"
MailItem.Subject = "Paul's Test"
MailItem.Body = "This is a Test"
MailItem.Display
MailItem.Send

Set MailItem = Nothing
Set OL = Nothing

End Sub
 

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