That is exactly what I tried to do originally, but it would not save
the open item. I would see the changes occur in the open item, but
the save would not make them permanent in the underlying message. When
(in testing) I let the macro run and then afterword I manaully close
the open item I am prompted with the "do you want to save the changes"
prompt. I don't want the User to get that prompt.
Let me show you the hokey way I got around this, Not what I consider
good programming. After the insert before statement I added:
SaveRTFBody = objItem.Body 'Save the message that Word has modified
objItem.Save 'Marks message saved but the Word changes are not saved
objItem.Body = SaveRTFBody 'Stuff the raw saved data into message body
objItem.Save ' This really saves the message changes to the underlying
message this time outside of Word of course.
Thank you for your time.
On Wed, 3 Mar 2010 11:02:37 -0500, "Ken Slovak - [MVP - Outlook]"
<kenslovak@mvps.org> wrote:
>Sorry, I glanced at the code and saw strFile and assumed text from a file.
>
>I ran your macro code and had no problems in either Outlook 2007 or 2010. I
>did get prompted for a file name of course since the Word doc had no file
>name. I was prompted with "Message goes her1.docx".
>
>To avoid that sort of thing for a previously unsaved Word doc you either
>need to asign the doc a name using SaveAs() or you can just save the
>underlying mail item if you don't want to save a document object to the file
>system:
>
> Application.ActiveInspector.CurrentItem.Save