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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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...
 
Back
Top