How to check a mail's *edit mode*?

N

nmore

Hi!


How to check if the ActiveInspector.CurrentItem is in *edit mode*
(it's only my terminology)

I would like to simply insert a text into the body of the currentl
opened mail (by clicking a toolbar button).
But Outlook inserts the text regardless if it's in edit mode or not
(And even it saves it without a prompt)
I can't find anything how to check this state.

The code is something like this:

30 Set objItem
Application.ActiveInspector.CurrentItem
40 Set objInsp = objItem.GetInspector
50 If objInsp.EditorType = olEditorWord Then
60 Set objDoc = objInsp.WordEditor
70 objDoc.ActiveWindow.Selection.InsertAfter psText
80 Else
90 objItem.HTMLBody = objItem.HTMLBody & psText
100 End If

Th
 
K

Ken Slovak - [MVP - Outlook]

You have to be more specific as to what you mean by edit mode. Is it a new
email item or a reply, forward or replyall? Is it an email opened for
reading that was set to be editable?
 
N

nmore

OK.
I should differentiate if the user just open an email for reading or
he/she creates a new letter or
* forwards or
* replies it
* or maybe use the Edit/Edit Message menu
and this way the letter become editable.

In the first case (just opening it for reading) he/she wouldn't be able
to insert text to the body of the email. Now it is possible, and even,
the modified body is saved by closing the email!
 
K

Ken Slovak - [MVP - Outlook]

If Item.Sent = False will tell you if an item is new or opened using
Forward, Reply or ReplyAll.

I don't know of any way to tell if the user has decided to edit an existing
message they opened using the Edit menu.

There's no real good way to know if an item was opened for Forward or one of
the Reply methods, other than checking for "Re:" or "Fwd" and so on but then
you get into the problem of language, where "AW" would be used in German for
example.
 

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