|
-
Nov 12th, 2000, 01:09 PM
#1
I want to use MAPI to send a note from VB in the background and I have two questions:
1) When my code gets to MAPISession1.SignOn and my mail system (Outlook) is not running, a dialog box is displayed by MAPI that asks me to "Choose Profile". How can I avoid that and just use the current profile name? MAPI seems to know what it is since "Microsoft Outlook" is shown in the Profile Name combo box.
2) How can I automatically delete the email from the user's mail system after it is sent?
-
Dec 16th, 2002, 06:17 AM
#2
Lively Member
i also need answers to these questions.....
-
Dec 16th, 2002, 06:48 AM
#3
Frenzied Member
Does this area help at all?: http://msdn.microsoft.com/library/de...t_you_need.htm
>>Specifying a Profile During Simple MAPI Logon
A call to the MAPILogon function produces different results depending on whether you specify a profile name. Normally a profile name is required. If you specify NULL for the lpszProfileName parameter of the MAPILogon function, MAPI first checks for an existing shared session. If possible, the shared session is used. If there is no shared session or if it cannot be used, the call to MAPILogon will fail.
>>Specifying Passwords with Simple MAPI
Whether a password is required for you to log on depends on the operating system which is running on the computer. If the operating system integrates messaging system credential checking into the initial system logon, you need not provide a password to the MAPILogon function. If not, a password is required from the user or from a cache location implemented by the client. Microsoft Windows NT and Microsoft Windows 95 do not require passwords for MAPILogon since the user's initial logon to the operating system suffices for both. Clients running with Microsoft Windows for Workgroups are required to provide a password for MAPILogon.
>>Requesting a Logon User Interface with Simple MAPI
A client application can log on either by displaying a logon dialog box to provide user interaction or by providing necessary credentials (profile name and password if necessary) programmatically. If you require user interaction, you can use the common dialog box provided by Simple MAPI or create your own. However, it is recommended that you use the standard MAPI dialog boxes whenever possible to promote a consistent look and ease of use.
The presence or absence of the MAPI_LOGON_UI value in the flFlags parameter of the MAPILogon function controls the logon dialog box display.
To force the dialog box to be displayed
Set MAPI_LOGON_UI in the flFlags parameter and set the lpszProfileName and lpszPassword parameters to NULL as follows:
flFlags |= MAPI_LOGON_UI;
MAPILogon ((ULONG) hWnd, NULL, NULL, flFlags, 0, &lhSession);
If you provide a value for lpszProfileName (and lpszPassword if necessary), MAPILogon attempts to establish a session without a user interface. Only if this attempt fails will MAPILogon display the logon dialog box for the user to enter new credentials.
Last edited by JordanChris; Dec 16th, 2002 at 06:54 AM.
-
Dec 16th, 2002, 09:36 AM
#4
Fanatic Member
Try this...
VB Code:
Set objSession = CreateObject("MAPI.session")
objSession.Logon "", "", False, False, 0
-
Dec 16th, 2002, 07:13 PM
#5
Thanks for the replies but I posted the original question 2 years ago
-
Dec 17th, 2002, 03:48 AM
#6
Frenzied Member
I noticed that, but only after I had added my reply!
I was thinking "Why is Martin asking these questions? He knows this forum inside out, and will know where to find this information".
But then I decided to leave my reply anyway, as the second poster might need the answers....
-
Dec 17th, 2002, 11:46 AM
#7
-
Dec 17th, 2002, 11:56 AM
#8
no question is ever too old to be answered
-
Dec 17th, 2002, 12:00 PM
#9
Lively Member
forgive me but this sounds like a slightly dodgy thing you are going to do,
is this part of a system you are building?
-
Dec 17th, 2002, 12:03 PM
#10
-
Dec 18th, 2002, 04:28 AM
#11
Lively Member
is there a way to get the default/current profile name from the registry?
-
Dec 18th, 2002, 05:05 AM
#12
Frenzied Member
My default profilem on my Windows 2000 system accessing Outlook in Corporate mode - talking to an Exchange Server - is at:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\DefaultProfile
-
Dec 19th, 2002, 02:40 AM
#13
Lively Member
-
Dec 19th, 2002, 03:42 AM
#14
It should be in one of these:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\DefaultProfile
or
HKEY_CURRENT_USER\Software\Microsoft\Windows Messaging Subsystem\Profiles\DefaultProfile
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|