![]() |
re-post: custom button in custom toolbar
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. |
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. |
re-post: custom button in custom toolbar
Eric Legault [MVP - Outlook] wrote:
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). That's great Eric. Let me try it as you have described and I'll post the results here soon. |
re-post: custom button in custom toolbar
Eric Legault [MVP - Outlook] wrote:
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, let me as u this: is it possible to add to or modify the code so that it will extract the line that is in the subject of whatever email is selected in whatever folder, e.g. Inbox or Sent, etc.? |
All times are GMT +1. The time now is 09:57 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-2006 OutlookBanter.com