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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

outofoffice assistant

Status
Not open for further replies.

mrmovie

Technical User
Oct 2, 2002
3,094
GB
Howdi all, i have a little issue with determining if the out of office is set, actually as i am typing this i am realising this might not be the right forum but hopefully the outlook interest here might be about to point me in the right location.

the 'whole story' stems from an exchange 2003 to 2007 which has left exch2003 out of office hidden messages in the mailbox....

Set objMessages = objMAPI.Inbox.HiddenMessages
Set objFilter = objMessages.Filter
Set objFiltered = objFilter.Fields.Add(&h001A001E,"IPM.Note.Rules.OOFTemplate.Microsoft")
For Each aMessage In objMesssages
...........
Next

These old exchange2003 hiddenmessages have the effect that is a user sets OOF the reply is some old message not the one they have entered into outlook!

the plan is for

For Each aMessage In objMessages
'backup message to text file for user later
aMessage.Delete
Next

this code works fine, however if the user has outofoffice turned on it has undesired effects, i.e. we are deleting one which is in use, people get blank out of office replies, outlook complains when you try and correct it, etc

I have tried to use .OutOfOffice property (see below) but always returns 'False' regardless

Set objMAPI = CreateObject("MAPI.Session")
objMAPI.Logon "", "", False, True, 0, False, strExServer & vbLf & strAlias
MsgBox "Out of Office = " & objMAPI.OutOfOffice

Clients are a mixture of outlook2003 and outlook2007, the above issue with .OutOfOffice = False is on my box running outlook2007

any pointers would be welcome

regards, have a nice weekend
 
To put the Outlook Out of Office message back in you do it like this:

objMAPISession.Logon "", "", False, True, 0, False, strMAPI

iOOO = Len(strOOO)
If iOOO = 4 Then 'True
strOOOMessage = objMAPISession.OutOfOfficeText
End If
MsgBox strOOOMessage & Chr(13) & strOOO & Chr(13) & iOOO

Set objMessages = objMAPISession.Inbox.HiddenMessages
Set objFilter = objMessages.Filter
Set objFiltered = objFilter.Fields.Add(&h001A001E,"IPM.Note.Rules.OOFTemplate.Microsoft")
For Each aMessage In objMessages
aMessage.Delete
Next
If iOOO = 4 Then
objMAPISession.Logoff
objMAPISession.Logon "", "", False, True, 0, False, strMAPI
objMAPISession.OutOfOfficeText = strOOOMessage
MsgBox objMAPISession.OutOfOfficeText
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top