Insert a text (hyperlinks) at a cursor position in the inspector w



I am trying to insert a text (hyperlinks) at a cursor position in the new
email (inspector) window on Outlook 2007. Our code worked fine in outlook xp
+ 2003. We get the WordEditor object, then get the document (QI),
Selection = spDoc->GetActiveWindow
Range = Selection->GetRange
Pass this Range object to spHyperLinks->Add (Doc->HyperLinks)
On Outlook 2007, spDoc->GetActiveWindow fails with hr = 0x800A180E

If you could tell me why GetActiveWindow is failing, any other way
(workarund) to do the same.

Any help is greatly appreciated.


Found a way...
Application->Selection->Range works fine.
The main problem was in the code execution order.
Initially I was adding an attachment and then inserting a body (kind of
atomic action), Now I insert a body, then add an attachments.

This works fine...

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