Tom,
This is a .NET newsgroup, not Access nor VB6.
To answer your question, the Namespace.Logon method allows you to specify
the profile to use:
Something like (untested):
Dim OutApp As Outlook.Applica tion
Dim OutNS As Outlook.NameSpa ce
Dim OutMail As Outlook.MailIte m
Set OutApp = CreateObject("O utlook.Applicat ion")
Set OutNS = OutApp.GetNames pace("MAPI")
OutNS.Logon "My Profile"
Set OutMail = OutApp.CreateIt em(olMailItem)
NameSpace.Logon has some optional parameters to specify password, UI, & new
Session...
Hope this helps
Jay
"Tom Glasser" <To********@dis cussions.micros oft.com> wrote in message
news:41******** *************** ***********@mic rosoft.com...
I have the following code in my Access application:
Dim OutApp As Outlook.Applica tion
Dim OutMail As Outlook.MailIte m
Set OutApp = CreateObject("O utlook.Applicat ion")
Set OutMail = OutApp.CreateIt em(olMailItem)
Then later in the code, I use 'With OutMail' to send emails.
Is there a way within the VB code to specifiy the Outlook profile to use ?
(My app needs to run unattended and I can't have Outlook prompting
for the profile to use.)
Thanks,
Tom