Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / January 2005

Tip: Looking for answers? Try searching our database.

Button to forward email to another address

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gwhitson - 25 Jan 2005 18:21 GMT
I would like to setup a tollbar button so a user can click it to forward
email that he feels is spam to anothe email address?

Thanks
Michael Bauer - 25 Jan 2005 18:49 GMT
Hi,

what is about the original forward button?

Signature

Viele Grüße
Michael Bauer

> I would like to setup a tollbar button so a user can click it to forward
> email that he feels is spam to anothe email address?
>
> Thanks
gwhitson - 25 Jan 2005 18:57 GMT
Would like to have the email address pre set and not have to enter it each time

> Hi,
>
[quoted text clipped - 5 lines]
> >
> > Thanks
Michael Bauer - 26 Jan 2005 07:27 GMT
Hi,

here is a sample for adding your own CommandBar with one -Button. To get
the button click event you need to declare a variable WithEvents

Private WihEvents YourButton as Office.CommandBarButton

Private Application_Startup()
 Set YourButton=CreateCommandBarButton(Application.ActiveExplorer _
   .CommandBars)
End Sub

Private Sub YourButton_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
 ' here your code goes
End Sub

Private Function CreateCommandBarButton(oBars As Office.CommandBars) As
Office.CommandBarButton
 On Error Resume Next
 Dim oMenu As Office.CommandBar
 Dim oBtn As Office.CommandBarButton
 Const BAR_NAME As String = "YourCommandBarName"
 Const CMD_NAME As String = "YourButtonName"

 Set oMenu = oBars(BAR_NAME)
 If oMenu Is Nothing Then
   Set oMenu = oBars.Add(BAR_NAME, msoBarTop, , True)
   Set oBtn = oMenu.Controls.Add(msoControlButton, , CMD_NAME, , True)
   oBtn.Caption = CMD_NAME
   oBtn.Tag = CMD_NAME

 Else
   Set oBtn = oMenu.FindControl(, , CMD_NAME)
   If oBtn Is Nothing Then
     Set oBtn = oMenu.Controls.Add(msoControlButton, , CMD_NAME, ,
True)
   End If
 End If

 oMenu.Visible = True
 Set CreateCommandBarButton = oBtn
End Function

Signature

Viele Grüße
Michael Bauer

> Would like to have the email address pre set and not have to enter it each time
>
[quoted text clipped - 7 lines]
> > >
> > > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.