Removing the send button on a mail item

S

Sune Keller

Hello,

I'm trying to create a new mail item (using C# and Office 2003) and then
show the mail form, but I would like to remove the "send" button. I'm doing
something like this:

MailItem mailItem = (MailItem)application.CreateItem(OlItemType.olMailItem);
mailItem.Subject = "Test Mail";
mailItem.Body = "Body text";
mailItem.To = "..@.....";
......
......
Inspector ins = application.Inspectors.Add(mailItem);

// This code remove the send button
((CommandBarControl)ins.CommandBars.FindControl(Missing.Value, 2617,
Missing.Value, Missing.Value)).Visible = false; // Toolbar
((CommandBarControl)ins.CommandBars.FindControl(Missing.Value, 3037,
Missing.Value, Missing.Value)).Visible = false; // Menu

ins.Display(true);
ins.Close(OlInspectorClose.olDiscard);

The problem is, that the code works fine, except if i'm using Word as my
email editor?? In this case the CommandBars.FindControl fails??? The button
doesn't exist???

Why is that?? I know that the command bars are different (it is all the
toolbars from Word), but i can't access the send button,,,,

What is the value for the send button when using Word?

Does anyone have some sample code that removes the send button when using
word???

Kind Regards
Sune
 

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