|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Im trying to use VBA to click on Send All button, wont succeedApplication.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 What version of Outlook is this? Is this code running within the Outlook VBA
process? -- Show quoteKen 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: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 > On May 7, 5:55 am, "Ken Slovak - [MVP - Outlook]" <kenslo***@mvps.org> yeah im running outlook 2003 and using the ThisOutlookSession withinwrote: > 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 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 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 <snip>news:1178595169.785795.55260@n59g2000hsh.googlegroups.com... 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 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 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. -- Show quoteKen 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: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 |
|||||||||||||||||||||||