![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: body, documentbookmark, email, insert, word |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
i have a word document and created a bookmark which highlights the text i am
interested in. i would like to insert the bookmark at the beginning of the email so that a user's signature appears after the bookmark. at the moment i i have been able to replace the body of the email with the bookmark- but this removes the signature- this is to work on new emails- here is the code: mItem.Body= bmark i have tried inserting the bookmark at the beginning of the body: mItem.Body.Insert(0, bmark) but this produces an object reference not set error i am using outlook 2003, with HTMLBodyFormat and Word 2003. Thanks |
| Ads |
|
#2
|
|||
|
|||
|
Am Fri, 15 Sep 2006 07:50:02 -0700 schrieb Paul:
Try this: mItem.Body= bmark & vbCRLF & mItem.Body -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- i have a word document and created a bookmark which highlights the text i am interested in. i would like to insert the bookmark at the beginning of the email so that a user's signature appears after the bookmark. at the moment i i have been able to replace the body of the email with the bookmark- but this removes the signature- this is to work on new emails- here is the code: mItem.Body= bmark i have tried inserting the bookmark at the beginning of the body: mItem.Body.Insert(0, bmark) but this produces an object reference not set error i am using outlook 2003, with HTMLBodyFormat and Word 2003. Thanks |
|
#3
|
|||
|
|||
|
nope-that doesnt work bmark "& operator isnt defined for types
Microsoft.Interop.Word.Bookmarks and String" what I am really trying to do is instantiate an outlook template and to add the user's default signature "Michael Bauer [MVP - Outlook]" wrote: Am Fri, 15 Sep 2006 07:50:02 -0700 schrieb Paul: Try this: mItem.Body= bmark & vbCRLF & mItem.Body -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- i have a word document and created a bookmark which highlights the text i am interested in. i would like to insert the bookmark at the beginning of the email so that a user's signature appears after the bookmark. at the moment i i have been able to replace the body of the email with the bookmark- but this removes the signature- this is to work on new emails- here is the code: mItem.Body= bmark i have tried inserting the bookmark at the beginning of the body: mItem.Body.Insert(0, bmark) but this produces an object reference not set error i am using outlook 2003, with HTMLBodyFormat and Word 2003. Thanks |
|
#4
|
|||
|
|||
|
Am Mon, 18 Sep 2006 03:05:02 -0700 schrieb Paul:
In a VBA group I assume VBA, not any .NET language, for which I canīt help you. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- nope-that doesnt work bmark "& operator isnt defined for types Microsoft.Interop.Word.Bookmarks and String" what I am really trying to do is instantiate an outlook template and to add the user's default signature "Michael Bauer [MVP - Outlook]" wrote: Am Fri, 15 Sep 2006 07:50:02 -0700 schrieb Paul: Try this: mItem.Body= bmark & vbCRLF & mItem.Body -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- i have a word document and created a bookmark which highlights the text i am interested in. i would like to insert the bookmark at the beginning of the email so that a user's signature appears after the bookmark. at the moment i i have been able to replace the body of the email with the bookmark- but this removes the signature- this is to work on new emails- here is the code: mItem.Body= bmark i have tried inserting the bookmark at the beginning of the body: mItem.Body.Insert(0, bmark) but this produces an object reference not set error i am using outlook 2003, with HTMLBodyFormat and Word 2003. Thanks |
|
#5
|
|||
|
|||
|
I think Michael was assuming, by the way you wrote your mItem.Body= bmark statement, that bmark was a string variable holding the text from your bookmark. In that case, bmark & mItem.Body should be a legitimate string expression in VB.Net. If, however, it's a Word.Bookmark object, then you need to get the text first from Bookmark.Range.Text.
In any case, if the message is in HTML format, you would need to use HTMLBody, not Body, to preserve the formatting. But that's doing things the hard way. Since you have Word as the editor, you should use Word methods. See http://www.outlookcode.com/codedetail.aspx?id=615 for sample code. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Paul" wrote in message ... nope-that doesnt work bmark "& operator isnt defined for types Microsoft.Interop.Word.Bookmarks and String" what I am really trying to do is instantiate an outlook template and to add the user's default signature "Michael Bauer [MVP - Outlook]" wrote: Am Fri, 15 Sep 2006 07:50:02 -0700 schrieb Paul: Try this: mItem.Body= bmark & vbCRLF & mItem.Body -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- i have a word document and created a bookmark which highlights the text i am interested in. i would like to insert the bookmark at the beginning of the email so that a user's signature appears after the bookmark. at the moment i i have been able to replace the body of the email with the bookmark- but this removes the signature- this is to work on new emails- here is the code: mItem.Body= bmark i have tried inserting the bookmark at the beginning of the body: mItem.Body.Insert(0, bmark) but this produces an object reference not set error i am using outlook 2003, with HTMLBodyFormat and Word 2003. Thanks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| word document from contact files so it looks like a directory | lomar | Outlook - Using Contacts | 1 | July 29th 06 11:26 PM |
| insert as text (to insert html into email body) | Iona | Outlook - General Queries | 1 | July 13th 06 01:10 PM |
| Creating appointment from a word document | emferrari@gmail.com | Outlook and VBA | 3 | June 9th 06 06:56 AM |
| Extracting Distribution list to Word document | toby.briggs@gmail.com | Outlook - General Queries | 2 | April 19th 06 01:26 PM |
| How do I convert Outlook calendar into a Word document? | Jeana | Outlook - Calandaring | 2 | March 7th 06 05:03 PM |