Sign in to follow this  
Followers 0
JohnBailey

Outlook COM - add Toolbar button or menu item

6 posts in this topic

I'm driving myself nuts! I can't find any conclusive information and I've tried all sorts of variations (too many to post) of CommandBars and what's list around that area of MSDN's site. I've searched google and MSDN's site. I can't get anything to work.

I want to add toolbar with a button or a new menu item to Outlook. I've been working with Outlook COM. I found out how to add a shortcut item ( I can post that if anyone cares). However, I just can't figure out how to add a toolbar with a button or a new menu item.

Any nudges or hints are MUCH, MUCH appreciated. I'm sure others would be interested too.

I want to use it to run a AUI3 script that preforms several COM operations with Outlook. Thanks in advanced to ANY help.


A decision is a powerful thing

Share this post


Link to post
Share on other sites



have a look at ANYGUI in my signature........


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

have a look at ANYGUI in my signature........

Yeah, I usually use this and I really like it! However, I can't seem to get it to work with Outlook. I tried variations of the following:

$targetapp = _GuiTarget ("Inbox - Microsoft Outlook")
$targetctl = _GuiTarget ($targetapp, 1, "", 15)
;ControlMove($targetapp, "", 15,80, 80, 800, 500);resize Edit1 control so everything fits
$mycheckbox1 = _TargetaddCheckbox ("Test", 50, 50, 150, 30, -1, -1, $targetctl);
$mybutton1 = _TargetaddButton("test button", 20, 20, 150, 30, -1, -1, $targetapp)
;$mycheckbox1[0] is controlid: $mycheckbox1[1] is control hwnd: $mycheckbox1[2] is child window
GUISetState(@SW_SHOW)
While WinExists($targetapp)
 $msg = GUIGetMsg(1)
 Select
  Case $msg[0] = $mycheckbox1[0]
   If BitAND(GUICtrlRead($mycheckbox1[0]), $GUI_CHECKED) Then
    ControlSetText($targetapp,"", $targetctl,"Checked")
   EndIf
   If BitAND(GUICtrlRead($mycheckbox1[0]), $GUI_UNCHECKED) Then
    ControlSetText($targetapp,"", $targetctl,"UnChecked")
   EndIf
  Case $msg[0] = $GUI_EVENT_CLOSE
   Exit
  Case Not WinExists($targetapp)
   Exit
 EndSelect
WEnd

A decision is a powerful thing

Share this post


Link to post
Share on other sites

Here's an example of what I'm working on

This doesn't give me an error, but it doesn't appear to do anything.

$oOutlookApp = ObjCreate("Outlook.Application")
$oOutlookApp.ActiveInspector.CommandBars.Item("Standard").Visible = True

A decision is a powerful thing

Share this post


Link to post
Share on other sites

Yeah, I usually use this and I really like it! However, I can't seem to get it to work with Outlook. I tried variations of the following:

$targetapp = _GuiTarget ("Inbox - Microsoft Outlook")
$targetctl = _GuiTarget ($targetapp, 1, "", 15)
;ControlMove($targetapp, "", 15,80, 80, 800, 500);resize Edit1 control so everything fits
$mycheckbox1 = _TargetaddCheckbox ("Test", 50, 50, 150, 30, -1, -1, $targetctl);
$mybutton1 = _TargetaddButton("test button", 20, 20, 150, 30, -1, -1, $targetapp)
;$mycheckbox1[0] is controlid: $mycheckbox1[1] is control hwnd: $mycheckbox1[2] is child window
GUISetState(@SW_SHOW)
While WinExists($targetapp)
 $msg = GUIGetMsg(1)
 Select
  Case $msg[0] = $mycheckbox1[0]
   If BitAND(GUICtrlRead($mycheckbox1[0]), $GUI_CHECKED) Then
    ControlSetText($targetapp,"", $targetctl,"Checked")
   EndIf
   If BitAND(GUICtrlRead($mycheckbox1[0]), $GUI_UNCHECKED) Then
    ControlSetText($targetapp,"", $targetctl,"UnChecked")
   EndIf
  Case $msg[0] = $GUI_EVENT_CLOSE
   Exit
  Case Not WinExists($targetapp)
   Exit
 EndSelect
WEnd
it might work now since i added client-coords to the last param in _GuiTarget() theres an example posted in the thread

seems to work for .net apps


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

Hi quaizywabbit,

i've the same problem with outlook and i would be nice if you can help me (us) with short example.

Can you show us how to add a new menu-item and (if possible) how to access the menu (if possible the "send/receive" menu?

This woulb be very :rolleyes: !

Thx

Dizzy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0