Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of Office emails

Status
Not open for further replies.

AndyGroom

Programmer
May 23, 2001
972
GB
Is it possible to turn the Out of Office email feature of Exchange on and off through VB? Or is it only Outlook that can do it?

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Try
Code:
sub OOOOff()
    MailboxAlias = UserBox1Form.UserBox1.Value
    Set msMapiSession = CreateObject("MAPI.Session")
    on error Resume next
    msMapiSession.Logon "","",False,True,True,True,strMailServer & vbLF & MailboxAlias
    if err.number = 0 then
        on error goto 0
        if msMapiSession.outofoffice = false and msMapiSession.outofofficetext = "" then
            UserBox1Form.OOOMessage.Value="No OOO Data Held - Nothing to turn off"
        else
            msMapiSession.outofoffice =False
        End if
    else  
        UserBox1Form.OOOMessage.Value="Error Opening Mailbox"
    end if

    Set msMapiSession = Nothing
    Set mrMailboxRules = Nothing
    OOOQuery
end sub

Got this code from an app we use at work, VBS to do the work other people don't want to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top