Click to See Complete Forum and Search --> : how to add button to outlook98
malinrob
October 18th, 2001, 08:58 AM
I would need to hook on outlook 97/98, when this is being opened and add a button to the toolbar. Adding button is not a problem, but I don't know how to catch the some event from Outlook 97/98. I have the same problem with Word97 and Excel97. In Office2000, there was no problem to do this. I just used IDTExtensibility2 interface (event was e.g. IDTExtensibility2_OnConnection...).
When I say it more simplier, how could I add a button to an Outlook98 toolbar by some dll or exe?
(I try to use ActiveX.dll as for Office2000).
Any help will be great. Thanx
malinrob
GeorgeT
October 18th, 2001, 09:27 AM
.OnAction set to macro. Use macros to re-write events to catch them from Outlook 97/98 by giving them a same name of the event.
Sub CreateTACToolBar()
Dim cbar as CommandBar
Dim btn as CommandBarControl
for Each cbar In Application.CommandBars
If cbar.Name = "TAC toolbar" then
cbar.Delete
End If
next
Application.CommandBars.Add Name:="TAC toolbar", Position:=msoBarTop
set btn = Application.CommandBars("TAC toolbar").Controls.Add(Type:=msoControlButton)
With btn
.Style = msoButtonCaption
.Caption = "Finalize"
.OnAction = "Finalize"
End With
set btn = Application.CommandBars("TAC toolbar").Controls.Add(Type:=msoControlButton)
With btn
.Style = msoButtonCaption
.Caption = "Add Employee"
.OnAction = "SetData"
End With
set btn = Application.CommandBars("TAC toolbar").Controls.Add(Type:=msoControlButton)
With btn
.Style = msoButtonCaption
.Caption = "Select folder"
.OnAction = "GetFolderPath"
End With
set btn = Application.CommandBars("TAC toolbar").Controls.Add(Type:=msoControlButton)
With btn
.Style = msoButtonCaption
.Caption = "Update Carry-out hrs"
.OnAction = "UpdateCarryIn"
End With
set btn = Application.CommandBars("TAC toolbar").Controls.Add(Type:=msoControlButton)
With btn
.Style = msoButtonCaption
.Caption = "Help"
.OnAction = "UnitHelp"
End With
Application.CommandBars("TAC toolbar").Visible = true
End Sub
malinrob
October 18th, 2001, 09:46 AM
I'm the beginner in ActiveX and Visual Basic.
So I would need to explain it more detaily.
This is what I did for Outlook2000
1. I created a new project in VB6.0 - ActiveX dll.
2. I created class module, where I inserted IDTExtensibility2 interface
3. I could catch opening of the Outlook2000 by implementing IDTExtensibility2_OnConnection sub.
4. After registering dll and inserting of appropriate values to registry it was done. That means that if I opened Outlook2000, I could hanlde this in IDTExtensibility2_OnConnection function.
Now the truth is that I do not understand how to do things you had written to me.
Can I use macros in Outlook98? How?
Could you explain it more detaily?
Tahnk you very much.
malinrob
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.