![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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 |
#2
|
|||
|
|||
![]()
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. |
#3
|
|||
|
|||
![]()
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. |
#4
|
|||
|
|||
![]()
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.? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom button in custom toolbar | sat | Outlook - General Queries | 2 | August 24th 06 09:03 PM |
re-post: custom button in custom toolbar | stef | Outlook - General Queries | 3 | August 8th 06 11:30 PM |
custom button in custom toolbar | stef | Outlook - General Queries | 0 | August 5th 06 08:57 PM |
custom button in custom toolbar | stef | Outlook and VBA | 0 | August 5th 06 08:57 PM |
Toolbar button to evoke a custom view ? | [email protected] | Outlook - General Queries | 1 | March 20th 06 02:30 PM |