A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , ,

Avoid login dialog





 
 
Thread Tools Display Modes
  #1  
Old September 25th 06, 11:48 PM posted to microsoft.public.outlook.program_vba
sshock@gmail.com
external usenet poster
 
Posts: 3
Default Avoid login dialog

I'm trying to automate creating a PST and placing some emails in it
from VC++.

I shouldn't need to log into an Exchange server, as I'm not sending or
receiving any email. I just want to create a PST file. I'm not
calling olNs.Logon, but it's still popping up anyways.

Unfortunately, I cannot get it to avoid showing the login dialog,
unless Outlook was already running and I was already logged in, or
unless I switch Outlook to offline. If I could programatically set it
to offline, that would solve my problem.

CApplication olApp;
COleException e;
if( !olApp.CreateDispatch("Outlook.Application", &e) ) { return; }
CNameSpace olNs(olApp.GetNamespace("MAPI"));
olNs.AddStoreEx(COleVariant(CString("C:\\plhtest.p st")), 2);
... (Create MailItem objects and add to newly created store) ...

Is there any way to solve this?

Thanks,
Phillip Hellewell

Ads
  #2  
Old September 26th 06, 06:47 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 1,592
Default Avoid login dialog

If you need to add a PST store to a profile without actually logging to that
profile, you will need to use the profile API - see numerous posts on this
subject:
http://www.google.com/search?hl=en&q...guremsgservice
plugProfMan (comes with the distributable version of Redemption) will let
you do that in a dozen lines of code or less -
http://www.dimastr.com/redemption/profiles.htm#example4/plug

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

wrote in message
ups.com...
I'm trying to automate creating a PST and placing some emails in it
from VC++.

I shouldn't need to log into an Exchange server, as I'm not sending or
receiving any email. I just want to create a PST file. I'm not
calling olNs.Logon, but it's still popping up anyways.

Unfortunately, I cannot get it to avoid showing the login dialog,
unless Outlook was already running and I was already logged in, or
unless I switch Outlook to offline. If I could programatically set it
to offline, that would solve my problem.

CApplication olApp;
COleException e;
if( !olApp.CreateDispatch("Outlook.Application", &e) ) { return; }
CNameSpace olNs(olApp.GetNamespace("MAPI"));
olNs.AddStoreEx(COleVariant(CString("C:\\plhtest.p st")), 2);
... (Create MailItem objects and add to newly created store) ...

Is there any way to solve this?

Thanks,
Phillip Hellewell



 




Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
a program is trying to access e-mail address - how do I avoid this marie Outlook and VBA 1 August 4th 06 05:00 AM
avoid drag and drop calendar Dean Outlook - Calandaring 1 June 23rd 06 01:24 PM
Outlook 2003, RPC/HTTP, no Login dialog dkeirns Outlook - Installation 0 June 6th 06 11:47 PM
Bounced back messages.... can I avoid? Dean Outlook - Using Contacts 1 March 29th 06 09:40 AM
Avoid duplication when sending to multiple groups pwrichcreek Outlook Express 3 January 22nd 06 05:11 PM


All times are GMT +1. The time now is 03:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Loans - Compare Mobile Phones - Loans - Chihuahua - Best Search Engine