Outlook 2007 Forms Assistance

J

Julius Perkins

I hope I'm posting this in the correct forum group...

I need help viewing & editing specific forms in Outlook. I essentially want to look at the existing 'Reply' and 'Reply to All' forms, make a copy of the existing 'Forward' form, save it under a new name, make some minor edits to it & incorporate it in such a way that will make it available for all current and new emails. My aim is to tweak the Forward action slightly, so that it includes the original recipients in the To & CC fields (just like 'Reply' & 'Reply to All') & pre-pends 'RE' instead of 'FW' in the subject line. That's it! I then need to create a new button on the quick access toolbar or the ribbon, if someone can link me to some documentation on how to modify the ribbon.

I'm not looking to be spoon-fed and am more than willing to read up on how to do this, but have not had much luck constructing my Google search in such a way that will help me locate the documentation I need.
If you must know why I'm asking, please read on.

We're trying to accommodate the ever popular request: 'Reply with Attachment' & 'Reply to All w/ Attachment' buttons in Outlook. Take the following real-world scenario using identical Windows XP systems & the Office 2007 Enterprise Suite:

1 - Sender sends an email to Recipient that contains an attachment of a document that needs to be reviewed.
2 - Recipient receives the email, double clicks it to open it (assume they don't use the Reading Pane), double click the document to open it, makes edits to it, clicks saves & closes the attachment.
3 - Recipient closes the email the opened from the sender (remember, we opened it to read it then opened the attachment), and receives the following prompt: "The attachments of the message "SUBJECT" have been changed. Do you want to save changes to this message?"
4 - Recipient clicks 'Yes', which updates the email with the modified version of the attachment, and now wants to be able to click a button that will reply to the recipient with the modified attachment.

This is what I've found so far:
1 - Clicking 'Forward' on an email containing an attachment will result in a new email being created, with blank TO, CC & BCC fields, a 'FW' prepended to the subject, the original email body contents and the attachment.
2 - So, clearly Outlook is capable of passing an/the attachment/s on to a new email. I checked the form actions (Open Email > Developer > Design This Form > (Actions) tab) and found 4 actions: Reply, Reply to All, Forward & Reply to Folder.
3 - Comparing the 'Forward', 'Reply' & 'Reply to All' actions reveal that the 'Address form like a:' values are 'Forward', 'Reply', 'Reply to All' respectively.
4 - This, to me, suggests there may be a [VB(?)] Function or some other form that it refers to when performing said '(Action)'. These are the forms or funtions I'm trying to view in an attempt to modify it in such a way that will result in the creation of a new option under the 'Address form like a:' field that can be used for any new '(Actions)' on the forms.
5 - After that it's just a matter of creating a button that a user can click to perform said action.

In 2007, when you open a Word attachment (and possibly others; I've not tested with Excel, PowerPoint etc.), edit it, click save (not save as) then close the document, the new changes are saved to a temp file in randomly named folder within:

%userprofile%\locals~1\tempor~1\content.outlook\

One is not prompted to choose a save location unless they perform a Save As; We're dealing with users here, not IT people, who instincitvely click "Save". Following the real-world example above, why would Outlook behave this way (ask you to save it back to the original email) if there's no way to Reply with the attachment directly to the sender in a single action? If the the Microsoft Developers were operating on the pretense that one should create a new email to send the now modified attachment back to the sender, why would Outlook care to look at that file? In most cases you don't want to modify the original, so why ask the user if they do? (These are rhetorical questions but if you have a good answer I'll listen!) I don't know why it was designed this way, but it is what it is and I'm running with it!

Lastly, just to say it: I've read a number of forums where several resopnses are arguments stating this is pointless because "the sender already has a copy of the attachment, why would they need it again" etc. This I understand wholly and to a certain extent agree. Having said this, please refrain from contributing by posting such comments as we're already aware of these users' idiosyncrasies. .
Submitted using http://www.outlookforums.com
 
S

Sue Mosher [MVP]

There is no Reply, Reply to All, or Forward form. All are messages and, as
such, use the default message form. Adding another action and some code
behind a message form to implement the behavior you want would require
substituting a custom form for the default message form -- but that may
cause problems with attachments on messages sent outside the organization. I
can't recommend that approach.

To reply with attachments can be done with a VBA solution. See
http://www.outlookcode.com/codedetail.aspx?id=1228 for sample code. The More
Commands command on the QAT drop-down will give you access to macros so you
can add them to the QAT. If you need to make this available to a lot of
people, an add-in would provie a better solution than VBA, however, as there
is no practical distribution method for VBA code.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Julius Perkins said:
I hope I'm posting this in the correct forum group...

I need help viewing & editing specific forms in Outlook. I essentially
want to look at the existing 'Reply' and 'Reply to All' forms, make a copy
of the existing 'Forward' form, save it under a new name, make some minor
edits to it & incorporate it in such a way that will make it available for
all current and new emails. My aim is to tweak the Forward action
slightly, so that it includes the original recipients in the To & CC
fields (just like 'Reply' & 'Reply to All') & pre-pends 'RE' instead of
'FW' in the subject line. That's it! I then need to create a new button on
the quick access toolbar or the ribbon, if someone can link me to some
documentation on how to modify the ribbon.

We're trying to accommodate the ever popular request: 'Reply with
Attachment' & 'Reply to All w/ Attachment' buttons in Outlook. Take the
following real-world scenario using identical Windows XP systems & the
Office 2007 Enterprise Suite:

1 - Sender sends an email to Recipient that contains an attachment of a
document that needs to be reviewed. 2 - Recipient receives the email,
double clicks it to open it (assume they don't use the Reading Pane),
double click the document to open it, makes edits to it, clicks saves &
closes the attachment. 3 - Recipient closes the email the opened from the
sender (remember, we opened it to read it then opened the attachment), and
receives the following prompt: "The attachments of the message "SUBJECT"
have been changed. Do you want to save changes to this message?" 4 -
Recipient clicks 'Yes', which updates the email with the modified version
of the attachment, and now wants to be able to click a button that will
reply to the recipient with the modified attachment.

This is what I've found so far:
1 - Clicking 'Forward' on an email containing an attachment will result in
a new email being created, with blank TO, CC & BCC fields, a 'FW'
prepended to the subject, the original email body contents and the
attachment. 2 - So, clearly Outlook is capable of passing an/the
attachment/s on to a new email. I checked the form actions (Open Email >
Developer > Design This Form > (Actions) tab) and found 4 actions: Reply,
Reply to All, Forward & Reply to Folder. 3 - Comparing the 'Forward',
'Reply' & 'Reply to All' actions reveal that the 'Address form like a:'
values are 'Forward', 'Reply', 'Reply to All' respectively. 4 - This, to
me, suggests there may be a [VB(?)] Function or some other form that it
refers to when performing said '(Action)'. These are the forms or funtions
I'm trying to view in an attempt to modify it in such a way that will
result in the creation of a new option under the 'Address form like a:'
field that can be used for any new '(Actions)' on the forms. 5 - After
that it's just a matter of creating a button that a user can click to
perform said action.
 
J

Julius Perkins

Sue,
Thank you for taking the time to not only read through my post & providing some feedback, but to also provide a response that should perform this wacky action.

Somehow, last night I came came up with the following that should accomplish this task. It works on my machine & one other so give it a go!
------SNIP------
Public Sub ReplyWithAttach()
'Make declarations
Dim myOlApp As Outlook.Application
Dim myInspector As Outlook.Inspector
Dim myItem As Outlook.MailItem
Dim myReplyItem As Outlook.MailItem
Dim myAttachments As Outlook.Attachments
Dim myReplyAttachments As Outlook.Attachments
Dim fso
Dim TempFolder As String
Set fso = CreateObject("Scripting.FileSystemObject")
TempFolder = fso.GetSpecialFolder(2)
Set myOlApp = CreateObject("Outlook.Application")
Set myInspector = myOlApp.ActiveInspector

'Create variable to store files names 10 max if you need more then 10, change the value below
Dim filenames(10) As String

If Not TypeName(myInspector) = "Nothing" Then
If TypeName(myInspector.CurrentItem) = "MailItem" Then
Set myItem = myInspector.CurrentItem
Set myAttachments = myItem.Attachments
If myAttachments.Count > 0 Then
For Count = 1 To myAttachments.Count
myAttachments.Item(Count).SaveAsFile "c:\" & myAttachments.Item(Count).DisplayName
filenames(Count) = myAttachments.Item(Count).DisplayName
Next

Set myItem = myInspector.CurrentItem
Set myReplyItem = myItem.Reply
Set myReplyAttachments = myReplyItem.Attachments

For Count = 1 To myAttachments.Count
myReplyAttachments.Add "c:\" & filenames(Count), olByValue, 1, ""
' Its questionable whether the double quotes above are needed.
myReplyItem.Display
fso.DeleteFile "c:\" & filenames(Count)
Next

End If
Else
MsgBox "The item is of the wrong type."
End If
End If
End Sub
------SNIP------

Its a bit clumsy but it works :) (Hey, I'm a VBA/VBScript, WMI, ADSI work in progress.)
I tried substituting myItem.Reply with myItem.ReplyAll, however it didn't seem to behave correctly; in fact it didn't work at all. I'd be interesting in hearing why if you can figure it out.

Thanks for your code. We'll give that a shot. While we won't be releasing this to the masses, it would be a suppore nightmare, its nice to know that should our stance change, we're much better off with your help.

Thank you immensely again!

Jules.
Submitted using http://www.outlookforums.com
 

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

Top