Outlook and Word Addin is mail item?

J

Jamie Ayer

My question is simple.

I would like to be able to use the WindowActivate Function in Word, which
passes me a Doc Item.
From here, how can I tell if that Doc is a WordMail item or not?

cheesy sample:
private void WordAddIn_WindowActivate(
Microsoft.Office.Interop.Word.Document Doc,
Microsoft.Office.Interop.Word.Window Wn )
{
if( Doc.Name.Trim() == "Untitled Message" )
{
if( this.loggedin )
CreateCustomToolbar( true );
else
CreateCustomToolbar(false);
}
}

Although what I have given here works, It does not work when you send a
reply that already has a subject because the name is no longer Untitled
Message. This is just as far as I have gotten so far. There must be a way
to tell if it's an active mail item?
 
J

Jamie Ayer

I got it... Thank you Ken. I found this further down buried in a post. I did
not see it as it wasn't the question asked....

EnvelopeVisible is useful to check if you are in a WordMail window when you
need to know that, and if customization context is in a template rather than
the doc it's needed to know when to create your buttons and when not to
create them.

------------------------------------------------

private void WordAddIn_WindowActivate(
Microsoft.Office.Interop.Word.Document Doc,
Microsoft.Office.Interop.Word.Window Wn )

{

if( Wn.EnvelopeVisible )

{

if( this.loggedin )

CreateCustomToolbar( true );

else

CreateCustomToolbar(false);

}

}
 

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