Cursor location in email item

G

Gabriel Fineman

I am using Outlook 2007 with VBA.
I Dim objDoc As Word.Document to set it up for the Word Object Model.
Then I Set objDoc = ActiveInspector.WordEditor to get the Word Object Model of the current mail item.
But then I do not see anything inside of objDoc that would give me the cursor location.
I want the cursor location to create a selection object.
Any ideas?
I do a respectable amount of coding in VBA/Access and /Excel, but hardly any
(so far) in Outlook. From the little bit of research I did today, Outlook is
a very different animal. Is there a user's guide or text that I should
tackle before doing anything serious in VBA/Outlook?

Specifically what I am looking for is the location of the cursor. I have in
mind writing a subroutine that identifies the entire paragraph in which the
cursor is locating it, and setting certain formatting (typeface, size, color)
for the entire paragraph. I will be using HTML and I have a little familiarity
with the DHTML object model, but the cursor location is eluding me so far.
On Wednesday, January 20, 2010 3:26 AM Michael Bauer [MVP - Outlook] wrote:
Outlook itself does not support that. But if Word is the email editor, you
can use the Word object model: The Inspector.WordEditor property returns a
Word.Document object.

--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
<http://www.vboffice.net/product.html?pub=6&lang=en>


Am Tue, 19 Jan 2010 22:16:01 -0800 schrieb Bob Bridges:

any
is
in
the
color)
familiarity
Submitted via EggHeadCafe - Software Developer Portal of Choice
Book Review: Excel 2010 - The Missing Manual [OReilly]
http://www.eggheadcafe.com/tutorial...w-excel-2010--the-missing-manual-oreilly.aspx
 
K

Ken Slovak

Use the Selection object, which is a Range object.




Gabriel Fineman said:
I am using Outlook 2007 with VBA.
I Dim objDoc As Word.Document to set it up for the Word Object Model.
Then I Set objDoc = ActiveInspector.WordEditor to get the Word Object
Model of the current mail item.
But then I do not see anything inside of objDoc that would give me the
cursor location.
I want the cursor location to create a selection object.
Any ideas?
I do a respectable amount of coding in VBA/Access and /Excel, but hardly
any
(so far) in Outlook. From the little bit of research I did today,
Outlook is
a very different animal. Is there a user's guide or text that I should
tackle before doing anything serious in VBA/Outlook?

Specifically what I am looking for is the location of the cursor. I have
in
mind writing a subroutine that identifies the entire paragraph in which
the
cursor is locating it, and setting certain formatting (typeface, size,
color)
for the entire paragraph. I will be using HTML and I have a little
familiarity
with the DHTML object model, but the cursor location is eluding me so
far.
Outlook itself does not support that. But if Word is the email editor,
you
can use the Word object model: The Inspector.WordEditor property returns
a
Word.Document object.

--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
<http://www.vboffice.net/product.html?pub=6&lang=en>


Am Tue, 19 Jan 2010 22:16:01 -0800 schrieb Bob Bridges:

any
is
in
the
color)
familiarity
On Wednesday, January 20, 2010 7:57 AM Sue Mosher [MVP] wrote:
In the future, please give your Outlook version, because there are
significant differences between versions. Michael's advice applies to
Outlook 2007 and also Outlook 2003 with Word as the email editor. For
Outlook 2003 with the built-in editor, see
http://www.outlookcode.com/codedetail.aspx?id=1358 for a code sample
that
shows how to work with the HTMLDocument and its Selection.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
Submitted via EggHeadCafe - Software Developer Portal of Choice
Book Review: Excel 2010 - The Missing Manual [OReilly]
http://www.eggheadcafe.com/tutorial...w-excel-2010--the-missing-manual-oreilly.aspx
 

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