![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Sorry for cross posting, already posted on
microsoft.public.outlook.pragram_addin, but couldn't get any response from there... The objective is to insert a hyperlinked image in message being composed by user. I'm doing this in C++ com addin. Any pointers to such code? Here is what I have done till now: IDispatchPtr pDispWordEditor; _DocumentPtr pDocumentPtr; InlineShapePtr pInlineShapePtr; HyperlinkPtr pHyperLinkPtr; _bstr_t address("http://www.google.com"); pDispWordEditor = pInspector-GetWordEditor(); //pInspector is pointer to inspector pDispWordEditor-QueryInterface(__uuidof(_Document), (LPVOID*)&pDocumentPtr); pInlineShapePtr = pDocumentPtr-Application-Selection-InlineShapes- AddPicture("C:\\image001.gif"); pHyperLinkPtr = pInlineShapePtr-Hyperlink; pHyperLinkPtr-Address = address; everything goes fine but, it crashes at last line where I try to set pHyperLinkPtr-Address. I investigated and found that. It might require to add hyperlink to Hyperlinks collection of document. So i tried : pInlineShapePtr-Select(); pHyperLinkPtr = pDocumentPtr-Application-ActiveDocument- Hyperlinks- Add(pDocumentPtr-Application-Selection-Range); But it is crashing at this line. Any clues? This appraoch will serve the purpose in case word is editor (which I think is always true for Outlook2007). How would this be achieved if word in not editor in Outlook 2003. |
#2
|
|||
|
|||
![]()
In Outlook 2003 with Word not the editor, you'd update the HTMLEditor property with your fully tagged HTML, including a and img elements for the link and image. See http://www.outlookcode.com/d/code/htmlimg.htm for a sample that demonstrates how to add an embedded image.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Pradeep" wrote in message ups.com... Sorry for cross posting, already posted on microsoft.public.outlook.pragram_addin, but couldn't get any response from there... The objective is to insert a hyperlinked image in message being composed by user. I'm doing this in C++ com addin. Any pointers to such code? Here is what I have done till now: IDispatchPtr pDispWordEditor; _DocumentPtr pDocumentPtr; InlineShapePtr pInlineShapePtr; HyperlinkPtr pHyperLinkPtr; _bstr_t address("http://www.google.com"); pDispWordEditor = pInspector-GetWordEditor(); //pInspector is pointer to inspector pDispWordEditor-QueryInterface(__uuidof(_Document), (LPVOID*)&pDocumentPtr); pInlineShapePtr = pDocumentPtr-Application-Selection-InlineShapes- AddPicture("C:\\image001.gif"); pHyperLinkPtr = pInlineShapePtr-Hyperlink; pHyperLinkPtr-Address = address; everything goes fine but, it crashes at last line where I try to set pHyperLinkPtr-Address. I investigated and found that. It might require to add hyperlink to Hyperlinks collection of document. So i tried : pInlineShapePtr-Select(); pHyperLinkPtr = pDocumentPtr-Application-ActiveDocument- Hyperlinks- Add(pDocumentPtr-Application-Selection-Range); But it is crashing at this line. Any clues? This appraoch will serve the purpose in case word is editor (which I think is always true for Outlook2007). How would this be achieved if word in not editor in Outlook 2003. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
inserting a hyperlinked image in messagebody | Pradeep | Add-ins for Outlook | 0 | October 23rd 07 12:01 PM |
Image in message body instead of attached | MSNews | Outlook - General Queries | 3 | April 13th 07 08:46 PM |
Inserting hyperlinks/file paths into message body of custom form | dch3 | Outlook - Using Forms | 2 | December 7th 06 05:02 PM |
Inserting RTF Text in a Message Body | Ridge Kennedy | Outlook and VBA | 4 | April 12th 06 03:29 PM |
Inserting a picture in the message body of a custom form | groom | Outlook - General Queries | 1 | February 8th 06 10:08 PM |