S
Sorin Vinatoru
Hi All,
I am writing a plugin that will modify some properties on a message and then
send it automatically when you click the button I added to the toolbar.
I am having a problem with automatically sending the message. I am trying to
do it by simulating a click on the "Send" button. The problem is that the
button coordinates for the send button are always the button coordinates of
the toolbar this button is in. So if the send button is the third button, you
will get the coordinates of the first one (which for some users is "Print"
button).
Here's my code:
CComQIPtr <Office::_CommandBars> cmdBars;
m_pInspector->get_CommandBars((Office::_CommandBars**)&cmdBars);
CComQIPtr <Office::CommandBarControl> spCmdBarCtrl;
CComVariant varId((long)5469, VT_I4);
spCmdBarCtrl = cmdBars->FindControl(CComVariant(msoControlSplitButtonPopup),
varId, vtMissing, vtMissing);
if (!spCmdBarCtrl) return;
int leftPoint = spCmdBarCtrl->GetLeft(); // this returns the bad location
I also checked out the coordinates using Outlook Spy application and they
look the same as those I find with my plugin.
This is happening in Outlook 2003, I haven't checked older versions yet.
Can you please help me find a workaround for this?
Thanks,
Sorin Vinatoru
I am writing a plugin that will modify some properties on a message and then
send it automatically when you click the button I added to the toolbar.
I am having a problem with automatically sending the message. I am trying to
do it by simulating a click on the "Send" button. The problem is that the
button coordinates for the send button are always the button coordinates of
the toolbar this button is in. So if the send button is the third button, you
will get the coordinates of the first one (which for some users is "Print"
button).
Here's my code:
CComQIPtr <Office::_CommandBars> cmdBars;
m_pInspector->get_CommandBars((Office::_CommandBars**)&cmdBars);
CComQIPtr <Office::CommandBarControl> spCmdBarCtrl;
CComVariant varId((long)5469, VT_I4);
spCmdBarCtrl = cmdBars->FindControl(CComVariant(msoControlSplitButtonPopup),
varId, vtMissing, vtMissing);
if (!spCmdBarCtrl) return;
int leftPoint = spCmdBarCtrl->GetLeft(); // this returns the bad location
I also checked out the coordinates using Outlook Spy application and they
look the same as those I find with my plugin.
This is happening in Outlook 2003, I haven't checked older versions yet.
Can you please help me find a workaround for this?
Thanks,
Sorin Vinatoru