Home All Groups Group Topic Archive Search About

Im trying to use VBA to click on Send All button, wont succeed

Author
4 May 2007 11:19 PM
vikky999
Application.ActiveExplorer.CommandBars.Item("Menu
Bar").Controls.Item("&Tools").Controls.Item("S&end/
Receive").Controls.Item("&Send All").Execute

I get Method Execute failed.


This However works
Application.ActiveExplorer.CommandBars.Item("Menu
Bar").Controls.Item("&File").Controls.Item("Wor&k Offline").Execute

Author
7 May 2007 12:55 PM
Ken Slovak - [MVP - Outlook]
What version of Outlook is this? Is this code running within the Outlook VBA
process?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


Show quote
"vikky999" <vikky***@gmail.com> wrote in message
news:1178320754.617147.271840@w5g2000hsg.googlegroups.com...
> Application.ActiveExplorer.CommandBars.Item("Menu
> Bar").Controls.Item("&Tools").Controls.Item("S&end/
> Receive").Controls.Item("&Send All").Execute
>
> I get Method Execute failed.
>
>
> This However works
> Application.ActiveExplorer.CommandBars.Item("Menu
> Bar").Controls.Item("&File").Controls.Item("Wor&k Offline").Execute
>
Author
8 May 2007 3:32 AM
vikky999
On May 7, 5:55 am, "Ken Slovak - [MVP - Outlook]" <kenslo***@mvps.org>
wrote:
> What version of Outlook is this? Is this code running within the Outlook VBA
> process?
>
> --
> Ken Slovak
> [MVP - Outlook]http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm
yeah im running outlook 2003 and using the ThisOutlookSession within
Outlook

looking for a way to click tools --> send/receive --> send all button
programatically

Show quote
>
> "vikky999" <vikky***@gmail.com> wrote in message
>
> news:1178320754.617147.271840@w5g2000hsg.googlegroups.com...
>
> > Application.ActiveExplorer.CommandBars.Item("Menu
> > Bar").Controls.Item("&Tools").Controls.Item("S&end/
> > Receive").Controls.Item("&Send All").Execute
>
> > I get Method Execute failed.
>
> > This However works
> > Application.ActiveExplorer.CommandBars.Item("Menu
> > Bar").Controls.Item("&File").Controls.Item("Wor&k Offline").Execute
Author
8 May 2007 2:05 PM
Ken Slovak - [MVP - Outlook]
You can try using the control ID of that button (5577):

Set Btn =
Application.ActiveExplorer.CommandBars.FindControl(msoControlButton, 5577)

Btn.Execute



An alternate approach for Outlook 2003 would be to get the
NameSpace.SyncObjects collection and call ns.SyncObjects(1).Start. That
would do a complete send/receive though.


--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"vikky999" <vikky***@gmail.com> wrote in message
news:1178595169.785795.55260@n59g2000hsh.googlegroups.com...
<snip>
Show quote
> yeah im running outlook 2003 and using the ThisOutlookSession within
> Outlook
>
> looking for a way to click tools --> send/receive --> send all button
> programatically
Author
9 May 2007 8:00 PM
vikky999
HI ken,

yeah i tried btn.execute.

it seems to work for the Send/Receive button
but doenst work for the Send button

I find that very strange indeed

i mean both are buttons and therefore of the same class and should
have the same methods. i wonder why that method fails for the "Send"
button but works for the "Send/receive" button.

any clues..yeah i tried sync object and thats not quite what im
looking for
Show quote
On May 8, 7:05 am, "Ken Slovak - [MVP - Outlook]" <kenslo***@mvps.org>
wrote:
> You can try using the control ID of that button (5577):
>
> Set Btn =
> Application.ActiveExplorer.CommandBars.FindControl(msoControlButton, 5577)
>
> Btn.Execute
>
> An alternate approach for Outlook 2003 would be to get the
> NameSpace.SyncObjects collection and call ns.SyncObjects(1).Start. That
> would do a complete send/receive though.
>
> --
> Ken Slovak
> [MVP - Outlook]http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm
>
> "vikky999" <vikky***@gmail.com> wrote in message
>
> news:1178595169.785795.55260@n59g2000hsh.googlegroups.com...
> <snip>
>
> > yeah im running outlook 2003 and using the ThisOutlookSession within
> > Outlook
>
> > looking for a way to click tools --> send/receive --> send all button
> > programatically
Author
9 May 2007 10:36 PM
Ken Slovak - [MVP - Outlook]
I'm not sure why it's failing but it's failing here too.

Set up a send/receive group that only sends and only includes the email
accounts you want used. Disable receive on that group. Use that group in a
SyncObjects(2) call. Other than calling send/receive that's all I can think
of at the moment.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


Show quote
"vikky999" <vikky***@gmail.com> wrote in message
news:1178740844.137668.82390@u30g2000hsc.googlegroups.com...
> HI ken,
>
> yeah i tried btn.execute.
>
> it seems to work for the Send/Receive button
> but doenst work for the Send button
>
> I find that very strange indeed
>
> i mean both are buttons and therefore of the same class and should
> have the same methods. i wonder why that method fails for the "Send"
> button but works for the "Send/receive" button.
>
> any clues..yeah i tried sync object and thats not quite what im
> looking for

AddThis Social Bookmark Button