Cursor location in email item?

  • Thread starter Thread starter Bob Bridges
  • Start date Start date
B

Bob Bridges

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'm 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'll be using HTML and I've a little familiarity
with the DHTML object model, but the cursor location is eluding me so far.
 
Outlook itself doesn't 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:
 
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.
 
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
 
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
 
Back
Top