
January 4th 07, 03:59 PM
posted to microsoft.public.outlook.program_vba
|
|
hooking the insert-File menu command (add attachment) in outlook 2003 (c# add in)
thanks
"Dmitry Streblechenko" wrote in message
...
No, there is no way to access controls on the Envelope toolbar other than
simulate mouse clicks using the mouse_event() Windows API function.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"semedao" wrote in message
...
sorry but I didn't understand "The "Envelope" toolbar exposes
a single control that contains everything else" , ok , it's not a
commandbarbutton , but there is no any other way to access it?
or if there is not some api , maybe by windows hooking ?
"Dmitry Streblechenko" wrote in message
...
Because it is broken :-) ?
The attachment icon in the Word editor is not a real CommandBarButton
conrol - you cannot access any buttons there. The "Envelope" toolbar
exposes a single control that contains everything else.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"semedao" wrote in message
...
thanks , now the next problem is that I used findcontrol/s and register
to the click event
when choose from insert-file or from the toolbar clicking on the down
arrow near the attachment and than choose "file.." it's work
but if I click directly on the attachment icon on the toolbar it's not
work.
I saw that the attachment icon have the same id (777 - wordmail) as the
other menu and drop down toolbar options !
so whay it's not working ?
thanks
"Dmitry Streblechenko" wrote in message
...
Here you go. Call the Inspector.IsWordMail method and branch your code
appropriately.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"semedao" wrote in message
...
What I determined is other thing
when using word as the email editor the value changed... (777 ?)
using without it - 1079

"Dmitry Streblechenko" wrote in message
...
It looks like Outlook is using id = 1079 in Outlook 2002 and id =
777 in Outlook 2003 (both Word editor, didn't check any
otherversions).
To make sure your code only depends on the Outlook version rather
than a locale, do not use the menu names, use
CommandBars.FindControl instead and specify the control id:
set btn = inspector.commandbars.findcontrol( ,777)
btn.execute
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"semedao" wrote in message
...
Hi all,
I try to replace the regular add file dialog that open when
clicking in the
Attach button.
I used code that :
1. get fired whenever I open new Email form (NewInspector)
2. get the CommandBar using
InsertCommandBar = Inspector.CommandBars["Insert"];
3. using
(CommandBarButton)InsertCommandBar.FindControl(myM issing, id,
myMissing,
myMissing, true);
to get the CommandBarButton that is clicked to insert new
attachment.
and then I register to it's
_CommandBarButtonEvents_ClickEventHandler
it's work well when the id paramenter whas 1079
than in other outlook languges versions , or other windows language
version
it's stop to work because or the :
InsertCommandBar = Inspector.CommandBars["Insert"];
statement return null , or the id was not 1079....
my question...
how can I determine for the correct values that are the same in all
versions
to handle it?
and also , how can I catch the insert attachment button that's
appear in the
side of the subject ?
|