Outlook Out Of Office Assistant

R

rflor

I'm trying to turn on the out of office assistant programmatically.
I'm referencing CDO 1.21 library, and I'm using the following code:

Dim objSession As MAPI.Session
Set objSession = CreateObject("mapi.session")
objSession.Logon , , False, False
objSession.OutOfOffice = True
objSession.Logoff
Set objSession = Nothing

The problem I'm having is when a user has their mail delivered to a
..pst. If they are set up to leave mail on the server then this code
works fine, if they have it being delivered to a .pst it fails. "Run
Time Error -2147467262 80004002) [collaboration data objects -
[e_nointerface]. If I change the delivery location this code works
fine.

Is there something else I am missing that will allow this, or is there
some way to programatically change the delivery location before
running the "objSession.OutOfOffice = True" line above, then change
the location again after the out of office it turned on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top