PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Login Method in Outlook 2002

Reply

Login Method in Outlook 2002

 
Thread Tools Rate Thread
Old 23-09-2003, 03:21 PM   #1
Paul
Guest
 
Posts: n/a
Default Login Method in Outlook 2002


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

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off