RE: Logon method of the Outlook NameSpace Object
- From: Manuel <Manuel@xxxxxxxxxxxxxxxx>
- Date: Fri, 27 Oct 2006 01:35:01 -0700
Hi Peter,
Thank you for your helpful response.
The Outlook is not connected to Exchange Server (for now)
I'm using the default Outlook profile created during setup and I have only
set a password to the personal folders.
If I start Outlook directly the password dialog will pop up.
Best regards,
Manuel
""Peter Huang" [MSFT]" wrote:
Hi Manuel,.
Can you describe how did you configurate your outlook profile?
Did the outlook connect to the Exchange Server?
If you start Outlook directly, will the password dialog pop up?
Based on my test, my Outlook is opened to connect to the Exchange server,
but I did not get prompt that I need input password.
Also the code below will work without call the Logon method.
Imports Outlook = Microsoft.Office.Interop.Outlook
Module Module1
Sub Main()
Dim oApp As New Outlook.Application
Dim oNs As Outlook.NameSpace = oApp.GetNamespace("mapi")
'oNs.Logon("Default Outlook", "myPassword", False, True)
Dim oFolder As Outlook.MAPIFolder =
oNs.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
For i As Integer = 1 To 5
Console.WriteLine(oFolder.Items(i).Subject)
Next
oApp.Quit()
End Sub
End Module
Also from the VBA help file, we did not recommend you use Password option.
Show All
Logon Method
See AlsoApplies ToExampleSpecificsLogs the user on to MAPI, obtaining a
MAPI session.
expression.Logon(Profile, Password, ShowDialog, NewSession)
expression An expression that returns a NameSpace object.
Profile Optional Variant. The MAPI profile name, as a String, to use for
the session.
Password Optional Variant. The password (if any), as a String,
associated with the profile. This parameter exists only for backwards
compatibility and for security reasons, it is not recommended for use.
Microsoft Oultook will prompt the user to specify a password in most system
configurations. This is your logon password and should not be confused with
PST passwords.
ShowDialog Optional Variant. True to display the MAPI logon dialog box
to allow the user to select a MAPI profile.
NewSession Optional Variant. True to create a new Outlook session. Since
multiple sessions cannot be created in Outlook, this parameter should be
specified as True only if a session does not already exist.
If you have any concern, please feel free to let me know.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
- Follow-Ups:
- RE: Logon method of the Outlook NameSpace Object
- From: "Peter Huang" [MSFT]
- RE: Logon method of the Outlook NameSpace Object
- References:
- RE: Logon method of the Outlook NameSpace Object
- From: "Peter Huang" [MSFT]
- RE: Logon method of the Outlook NameSpace Object
- Prev by Date: Communicate with parallel port via web interphace
- Next by Date: RE: Logon method of the Outlook NameSpace Object
- Previous by thread: RE: Logon method of the Outlook NameSpace Object
- Next by thread: RE: Logon method of the Outlook NameSpace Object
- Index(es):
Relevant Pages
|