Using Word document.selection object

V

Vaughan

I posted a question on here a couple of weeks ago asking how to return the
current selected text in the Note/Message control of an IPM.Note-based form.
Sue, you advised me that I might be able to use WordMail's Document.Selection
property to get what I wanted.

I couldn't get to it for a couple of weeks, but I just had a try, and I
can't figure out how to return this property. Please could you possibly give
me a snippet of example code to work with, or point me to an example
somewhere?

Thanks

Vaughan
 
S

Sue Mosher [MVP-Outlook]

Code behind the form:

Set objInsp = Item.GetInspector
Set objDoc = objInsp.WordEditor
Set objSel = objDoc.Selection

From there, use the properties and methods of the Selection object from
Word's object model.
 
V

Vaughan

OK, Sue, thanks for the help. I had a try with this, but objDoc.Selection
generates an error:

Object does not support this properrty or method: 'objDoc.Selection'

Is there something else I need to do here?

One thought ... Although I am using OL2003, the rest of my office
installation is version 2002 with SP3, could this be the problem?
 
S

Sue Mosher [MVP-Outlook]

Yes, that's the basic problem. WordMail requires a matching version, in your
case Word 2003. In your configuration, you will have to use Redemption's
SafeInspector object.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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

Top