PDA

Click to See Complete Forum and Search --> : .And another one....


Mark Sreeves
Feb 2nd, 2000, 09:04 PM
I need to start an outlook session with a particular profile

This doesn't work.

The line
oNameSpace.Logon "MyProfile", , False, True
should force a new session usin MyProfile.

But if outlook is already running, it still uses the current profile.

what is going wrong?
:mad: :confused:

Sub ReadEmail()
Dim oApp As Outlook.Application
Dim oNameSpace As Outlook.NameSpace
Dim oFolder As Outlook.MAPIFolder
Dim oMailItem As Object
Dim sMessage As String
Set oApp = New Outlook.Application
Set oNameSpace = oApp.GetNamespace("MAPI")

oNameSpace.Logon "MyProfile", , False, True


Set oFolder = oNameSpace.GetDefaultFolder(olFolderInbox)

.......
.......
......


ps don't bother telling me there's no End Sub! :)

------------------
Mark Sreeves
Analyst Programmer

Mark.Sreeves@Softlab.co.uk
A BMW Group Company