A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VBA snippet that presses a toolbar button?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 19th 08, 04:25 PM posted to microsoft.public.outlook.program_vba
Michael Moser
external usenet poster
 
Posts: 32
Default VBA snippet that presses a toolbar button?

VanguardLH wrote:
Michael Moser wrote:

Outlooks Rules Wizard among other actions also offer an option
"perform a custom action".
If one selects that, however, one gets a selection box (apparently
supposed to be a list of selectable actions, which - however - is
empty, i.e. not a single action to choose from).

Where/how can one define such custom actions? I would like to press a
specific button (or the equivalent of the command behind that
button) on those emails.

Michael


You will have to define those custom actions. Learn VBA. Visit
http://www.outlookcode.com to get some examples.


Since I am not a VBA expert: Would someone by chance be willing to share
a code snippet that allows to programmatically presses a specific
Toolbar button (or call the corresponding action)?

Michael

  #2  
Old August 19th 08, 07:24 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default VBA snippet that presses a toolbar button?



Michael, in general it works this way:

Dim Bnt as Office.CommandbarButton
Dim Bars as Office.Commandbars
Dim BtnID&

' ref to the folder toolbars
Set Bars=Application.ActiveExplorer.Commandbars

' find a specific button by its ID
' example, ID for the Reply button
BtnID = 354
Set Bnt=Bars.FindControl(,BtnID)
Btn.Execute

If you don't know the ID of the button you're looking for, you may use
OutlookSpy from www.dimastr.com for finding it out.

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 19 Aug 2008 17:25:20 +0200 schrieb Michael Moser:

VanguardLH wrote:
Michael Moser wrote:

Outlooks Rules Wizard among other actions also offer an option
"perform a custom action".
If one selects that, however, one gets a selection box (apparently
supposed to be a list of selectable actions, which - however - is
empty, i.e. not a single action to choose from).

Where/how can one define such custom actions? I would like to press a
specific button (or the equivalent of the command behind that
button) on those emails.

Michael


You will have to define those custom actions. Learn VBA. Visit
http://www.outlookcode.com to get some examples.


Since I am not a VBA expert: Would someone by chance be willing to share
a code snippet that allows to programmatically presses a specific
Toolbar button (or call the corresponding action)?

Michael

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can someone post a VB snippet to change some form settings? Default User Outlook and VBA 1 May 30th 07 06:42 PM
button on toolbar Pam Coleman Outlook - Using Forms 3 August 22nd 06 05:43 PM
New Email Button on toolbar Angel Outlook and VBA 1 June 14th 06 04:30 PM
click a button on the toolbar (via VBA?) Dan Outlook and VBA 7 May 2nd 06 09:35 AM
click a button on the toolbar (via VBA?) Dan Outlook - General Queries 2 May 1st 06 01:39 PM


All times are GMT +1. The time now is 11:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.