views:

62

answers:

1

I am using ms-outlook 2003, i want to hide the built-in send button and use the custom button to send the mail.

As i have worked on C,C++ and on Java, dont know how to work on VB/VBScript/VBA, can any body tell me how to hide this button and also how to send mail from custom button, how to access the fields of mail (ie., the TO field, Subject field, Msg Body, attachment etc).

A: 

Hi,

If you want to do this you have to get a reference to the button via its ID. Then you can control it properties such as enable / disable it.

VB

Set oCommandBars = Item.GetInspector.CommandBars
Set oStandardBar = oCommandBars("Standard")

Counter = 1

For Counter = 1 To oStandardBar.Controls.Count
    If oStandardBar.Controls(Counter).ID = "1975" Then
        oStandardBar.Controls(Counter).Enabled = False
        Exit For
    End If
Next

But as Lazarus say's there are many ways to skin a cat so may be a little more explanation would help, are you doing this in and Addin or via Automation etc?

76mel