VBOffice

Determine the Cursor Position

Since Word's object model is available in Outlook you can set the cursor to a certain position in a message.

Last modified: 2011/03/24 | Accessed: 52.266  | #90
◀ Previous sample Next sample ▶
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.

The Outlook object model doesn't support to set the cursor to a certain position. However, that's possible when Word is used as the e-mail editor. Until Outlook 2003 Word was optional, since Outlook 2007 it's always used, not only for emails but for all of the item types.

The example demonstrates how to set the cursor to the end position of the message field.


tip  How to add macros to Outlook
Public Sub SetCursor()
  Dim Ins As Outlook.Inspector
  Dim Doc As Word.Document
  Dim Range As Word.Range
  Dim Pos As Long

  Set Ins = Application.ActiveInspector
  Set Doc = Ins.WordEditor
  If Not Doc Is Nothing Then
    Pos = Doc.Range.End - 1
    Set Range = Doc.Range(Pos, Pos)
    Range.Select
  End If
End Sub
Category-Manager Category-Manager
With Category-Manager you can group your Outlook categories, share them with other users, filter a folder by category, automatically categorize new emails, and more. You can use the Addin even for IMAP.
email  Send a message