Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Outlook Newsgroups
Outlook VBA Programming
Outlook 2007 - Error Inserting Text into Received E-mail
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Ken Slovak - [MVP - Outlook], post: 4873370"] Well, similar code using objDoc.Characters(1).InsertBefore strFile does work in a new mail item, so it's a matter of WordMail not allowing writing to the item unless it's set for editing. About the only way I see to do that is to find the control that allows editing an email item and execute it. Even with Outlook 2007 you can do that using the old style CommandBar interface. Dim oButton As Office.CommandBarButton Set oButton = oInspector.CommandBars("Menu Bar").FindControl(Id:=5604, Recursive:=True) oButton.Execute After that the email is put into edit mode and the Word type code objDoc.Characters(1).InsertBefore strFile will work. I'd see if saving the email item as well as the Document item or instead of that is necessary though. An alternative would be to use the Outlook object model and do something like this: Dim strBody As String strBody = objMsg.Body strBody = strFile & strBody objMsg.Body = strBody [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Outlook Newsgroups
Outlook VBA Programming
Outlook 2007 - Error Inserting Text into Received E-mail
Top