PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Distinguish between Outlook word email and word document

 
 
New Member
Join Date: Aug 2010
Posts: 2
 
      31st Aug 2010
Hi,

I am developing an add-in for outlook that consists of creating a customized send button next to the standard one. when outlook is configured to use the word editor, when I add the customized send button to the command bar of the mail in edit mode, the add-in is also added in word document. The reason is that the word editor is activated in outlook. How can I tell my add-in not to add the button in word as well. I don't want to deactivate the editor word. There must be a way how to detect the opened application. I searched for my problem on the internet and people said to test if the kind of the document is word mail or word document. Here's part of my code that didn't work correctly:


//event triggered when item is opened

private void Inspectors_NewInspector(Outlook.Inspector i)

{

//some code to test if it is a maiitem, etc.



Word.Document document = (Word.Document)i.WordEditor;





if (document.Kind.ToString() == "wdDocumentEmail")

addsendbutton();

}

The problem is that the button is still showing at word level. Visual studio is not launching the condition on all the windows. So he’s adding it in word as well, although word document is a wdDocumentLetter.



I have 2 options in mind:



1-The code must not be called at new inspector level. Because this trigger is not launched in the case of the word document

2-The inspector from which we get the word editor is not the right one for word document (Word.Document document = (Word.Document)i.WordEditor;)


Does anyone have an idea about how to solve this? I would really appreciate any help.
Thanks,
Nad
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email word document attachments opening as Word Pad? =?Utf-8?B?QkFCUw==?= Microsoft Outlook Discussion 3 23rd Aug 2007 07:40 PM
outlook email to word document template Dave Microsoft Outlook Discussion 0 13th May 2006 04:40 PM
How do I email a document directly out of word using outlook? =?Utf-8?B?Y2hhc21hZGVy?= Microsoft Outlook Discussion 1 24th Feb 2006 05:32 PM
Document edited with MS word-2003; MS-word crashes if that document is opened with older MS word versions qazmlp Microsoft Word Document Management 2 27th Apr 2005 07:11 AM
Sending Word document as Email thru Outlook Westontony Microsoft Word Document Management 0 16th Sep 2003 07:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:28 AM.