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 - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

re-post: custom button in custom toolbar



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 7th 06, 09:54 PM posted to microsoft.public.outlook,microsoft.public.outlook.general,microsoft.public.outlook.program_vba
stef
external usenet poster
 
Posts: 83
Default 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.

  #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.


  #3  
Old August 8th 06, 09:57 PM posted to microsoft.public.outlook,microsoft.public.outlook.general,microsoft.public.outlook.program_vba
stef
external usenet poster
 
Posts: 83
Default 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.
  #4  
Old August 8th 06, 11:30 PM posted to microsoft.public.outlook,microsoft.public.outlook.general,microsoft.public.outlook.program_vba
stef
external usenet poster
 
Posts: 83
Default 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.?
 




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
custom button in custom toolbar sat Outlook - General Queries 2 August 24th 06 09:03 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
RecipientControl in Post custom form Bill Outlook - Using Forms 1 May 11th 06 08:32 PM
Toolbar button to evoke a custom view ? [email protected] Outlook - General Queries 1 March 20th 06 02:30 PM


All times are GMT +1. The time now is 08:58 AM.


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.