• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

knowing when Word is in use as Outlook's email editor

Hi,

I'm writing a Word add-in that needs to know when the active document is actually an Outlook email being edited. Any suggestions on how to detect that the current document is actually an email?
0
thePrisoner
Asked:
thePrisoner
  • 3
  • 2
  • 2
  • +2
1 Solution
 
BrianGEFF719Commented:
check to see if the document contains HTML, more than likely it will be Outlook.


-Brian
0
 
BrianGEFF719Commented:
Application.Name ?


-brian
0
 
mADOchistCommented:
??? need more info ??? Do you use word as an e-mail editor or simply outlook??? Do you wish to do this only for e-mail attachements ???
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
thePrisonerAuthor Commented:
Word is set as the email editor for Outlook, so i get the Word toolbars -- including my addin. I don't want that, I want to my addin to hide the toolbar and go inactive if it residing in Outlook.
0
 
Krelek200Commented:
Are you say that you do not want the toolbars to show?
0
 
thePrisonerAuthor Commented:
I know how to make or unmake the my toolbar visible, but I need a way to detect if that particular instance of Word is being used by Outlook
0
 
Krelek200Commented:
Usely it can be found in the options mail format properties.  It is a check box under it and so should be a True False or 0 1 setup...

I think the property is called UseWordMail....

If you force that property to false, it will take away Word as the email editor for Outlook
0
 
thePrisonerAuthor Commented:
The problem with the answer Krelek200 is that I don't know of a way to tell if the word document is being opened in Word or a new email is being created in Outlook. application.name returns "Microsoft Word" in both cases, as does activedocument.parent

My goal here is to not show my addin-s toolbar if the document is actually an email. And -regardless of what the MS documentation says - application.mailmessage exists in just a doc created in word,

The key is finding a way for the addin to distinguish wether the activedocument is an email in outlook or a doc in word.
0
 
HammerHaimCommented:
Hi

The Kind property on the Word.Document class is wdDocumentEmail (2) when the current document is an eMail.

If you want to trap the creation of the document I think you have to do so from the creating application, i.e. Outlook. If you create an addin for Outlook you can trap the creation of a new Inspector object and call its IsWordMail method, which will return True if Word is used as editor. You should then be able to remove any offending toolbars etc.

Hope it helps
Jacob Hammer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now