CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2001
    Location
    Slovakia, Europe
    Posts
    58

    how to add button to outlook98

    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

  2. #2
    Join Date
    Oct 2000
    Posts
    58

    Re: how to add button to outlook98

    .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





  3. #3
    Join Date
    Sep 2001
    Location
    Slovakia, Europe
    Posts
    58

    Re: how to add button to outlook98

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured