View Single Post
  #2  
Old August 8th 06, 09:36 PM posted to microsoft.public.outlook,microsoft.public.outlook.general,microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default re-post: custom button in custom toolbar

Paste this code into the top of a new module in the Outlook VBA editor:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String _
, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal
nShowCmd As Long) As Long
Public Const conSwNormal = 1

Sub RunSavedSearch()
ShellExecute 0, "open", "C:\Temp\test.oss", vbNullString, "", conSwNormal
End Sub

This will run the saved search file called "test.oss" in your C:\Temp
folder. Then map the RunSavedSearch macro to your custom toolbar button via
the Customize dialog (click Macros in the Categories list of the Commands tab
to see your macros).

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"stef" wrote:

OL 2002 SP3
Win XP HE SP1

Follow-up to: microsoft.public.outlook

Hi,
How do I create a custom button for a customized search I have saved as
..oss, in a new custom toolbar I have created for that purpose/or just as
an addition to the regular toolbar?
Tx a lot.


Ads