S
sshock
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.pst")), 2);
... (Create MailItem objects and add to newly created store) ...
Is there any way to solve this?
Thanks,
Phillip Hellewell
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.pst")), 2);
... (Create MailItem objects and add to newly created store) ...
Is there any way to solve this?
Thanks,
Phillip Hellewell