(You can choose or or both)

Tuesday, September 29, 2009

Canned answer from Outlook


(Souriez! Photo prise par Christelle).

Technical stuff today. How to set up a canned response (from Outlook 2007, in my case).

Open up Tools>Macro>Visual Basic Editor, double click ThisOutlookSession, and paste this (or similar) in...
Public Sub CannedResponseInfo()
'Insert text
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.TypeText Text:="Hello," & vbCrLf & vbCrLf & _
"Thank you for bla bla bla " & _
"And bla bla bla." & vbCrLf & vbCrLf & _
"Bla bla ispum florum diddle doo," & vbCrLf & vbCrLf & _
"Yours," & vbCrLf & vbCrLf & _
"Slartibartfast"

'bonus: insert attachment
Call item.Attachments.Add("C:\Users\Public\Documents\topsecret.pdf")
End Sub
What can you do with it?
Well, in Outlook 2007, you can 'Customize the Quick Access Toolbar', and call the macro from there.

This is not the same as an 'out of office' reply, which goes to anyone who sends a mail.

In this case, when I hit 'reply to', I have three different 'canned replies' ('yes', 'no' and 'it will cost you'), which fill out the text, and add the attachment. Crucially, the macro doesn't send the mail, so I can modify it by hand, and then send it.
In previous versions of Outlook, I imagine you have to do something like customizing the toolbar (right click), or just call the macro 'manually', via the tools->macros menu (or something like that - cf here).


1 comment yet :

Anonymous said...

This could do with a bit more explanation - like, what will it do :) It looks potentially useful, but what is the difference between this and an autoreply - can you target it at particular mailers?