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

Shorcut button for Message Options



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 2nd 06, 04:19 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 1
Default Shorcut button for Message Options

Hi,
I'd like to be able to add two shortcut buttons to the toolbar on a new
mail message. Instead of clicking on Options Request a read receipt
OR
Options Save sent items...etc
I'd like to be able to have a button right on the standard toolbar for
each of these two options. It may only save a couple clicks but every
click helps!

Can I do this with VBA since there doesn't appear to be an option in
the available shortcut buttons in "customize"?

It would also be nice to customize where the sent message will be saved
to rather than the default "sent items" folder.

Thanks.

  #2  
Old August 2nd 06, 04:36 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Shorcut button for Message Options

The first two things are relatively simple. You need two macros:

Sub DoNotSaveReply()
'Clears the 'Save sent messages to' option in the Message Options dialog
Dim objMessage As Object

Set objMessage = Application.ActiveInspector
objMessage.CurrentItem.DeleteAfterSubmit = True
Set objMessage = Nothing
End Sub

Sub RequestReadReceipt()
'Clears the 'Save sent messages to' option in the Message Options dialog
Dim objMessage As Object

Set objMessage = Application.ActiveInspector
objMessage.CurrentItem.ReadReceiptRequested = True
Set objMessage = Nothing
End Sub

Having sent items saved to a specific folder is a little tricker.

Public Sub SaveReplyToSpecificFolder()
On Error Resume Next

Dim objMessage As Outlook.MailItem
Dim objFolder As Outlook.MAPIFolder, objNS As Outlook.NameSpace
Dim SentItemsFolderID As String
Dim SentItemsFolderStoreID As String

SentItemsFolderID = "00000000796361434A311F408F1D9BA8D935F32802810 000"
SentItemsFolderStoreID =
"0000000038A1BB1005E5101AA1BB08002B2A56C2000070737 47072782E646C6C00000000000000004E495441F9BFB80100A A0037D96E000000433A5C446F63756D656E747320616E64205 3657474696E67735C657269636C5C4C6F63616C20536574746 96E67735C4170706C69636174696F6E20446174615C4D69637 26F736F66745C4F75746C6F6F6B5C657269636C6D61696C2E6 D7670732E6F72672D30303030303031302E70737400"

If Application.ActiveInspector.CurrentItem.Class
Outlook.OlObjectClass.olmail Then Exit Sub
Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.GetFolderFromID(SentItemsFolderID,
SentItemsFolderStoreID)
If objFolder Is Nothing Then
MsgBox "Unable to set Sent Message folder."
Exit Sub
End If
Set objMessage = Application.ActiveInspector.CurrentItem
Set objMessage.SaveSentMessageFolder = objFolder

Set objNS = Nothing
Set objMessage = Nothing
Set objFolder = Nothing
End Sub

You can use Outlook Spy (http://www.dimastry.com) to easily get the EntryID
and FolderID values for a specific folder, or use code (navigate to the
folder, use ActiveExplorer.CurrentFolder, etc.). Otherwise, navigate the
NameSpace.Folders collection to retrieve a specific MAPIFolder object.

To map custom toolbar buttons to a macro, choose Macros from the Categories
list in the Commands tab of the toolbar customization dialog, and select the
macro on the right.

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


" wrote:

Hi,
I'd like to be able to add two shortcut buttons to the toolbar on a new
mail message. Instead of clicking on Options Request a read receipt
OR
Options Save sent items...etc
I'd like to be able to have a button right on the standard toolbar for
each of these two options. It may only save a couple clicks but every
click helps!

Can I do this with VBA since there doesn't appear to be an option in
the available shortcut buttons in "customize"?

It would also be nice to customize where the sent message will be saved
to rather than the default "sent items" folder.

Thanks.


  #3  
Old August 4th 06, 01:52 PM posted to microsoft.public.outlook.program_vba
t220
external usenet poster
 
Posts: 1
Default Shorcut button for Message Options


Eric wrote:
The first two things are relatively simple. You need two macros:

Sub DoNotSaveReply()
'Clears the 'Save sent messages to' option in the Message Options dialog
Dim objMessage As Object

Set objMessage = Application.ActiveInspector
objMessage.CurrentItem.DeleteAfterSubmit = True
Set objMessage = Nothing
End Sub

Sub RequestReadReceipt()
'Clears the 'Save sent messages to' option in the Message Options dialog
Dim objMessage As Object

Set objMessage = Application.ActiveInspector
objMessage.CurrentItem.ReadReceiptRequested = True
Set objMessage = Nothing
End Sub

Having sent items saved to a specific folder is a little tricker.

Public Sub SaveReplyToSpecificFolder()
On Error Resume Next

Dim objMessage As Outlook.MailItem
Dim objFolder As Outlook.MAPIFolder, objNS As Outlook.NameSpace
Dim SentItemsFolderID As String
Dim SentItemsFolderStoreID As String

SentItemsFolderID = "00000000796361434A311F408F1D9BA8D935F32802810 000"
SentItemsFolderStoreID =
"0000000038A1BB1005E5101AA1BB08002B2A56C2000070737 47072782E646C6C00000000000000004E495441F9BFB80100A A0037D96E000000433A5C446F63756D656E747320616E64205 3657474696E67735C657269636C5C4C6F63616C20536574746 96E67735C4170706C69636174696F6E20446174615C4D69637 26F736F66745C4F75746C6F6F6B5C657269636C6D61696C2E6 D7670732E6F72672D30303030303031302E70737400"

If Application.ActiveInspector.CurrentItem.Class
Outlook.OlObjectClass.olmail Then Exit Sub
Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.GetFolderFromID(SentItemsFolderID,
SentItemsFolderStoreID)
If objFolder Is Nothing Then
MsgBox "Unable to set Sent Message folder."
Exit Sub
End If
Set objMessage = Application.ActiveInspector.CurrentItem
Set objMessage.SaveSentMessageFolder = objFolder

Set objNS = Nothing
Set objMessage = Nothing
Set objFolder = Nothing
End Sub

You can use Outlook Spy (http://www.dimastry.com) to easily get the EntryID
and FolderID values for a specific folder, or use code (navigate to the
folder, use ActiveExplorer.CurrentFolder, etc.). Otherwise, navigate the
NameSpace.Folders collection to retrieve a specific MAPIFolder object.

To map custom toolbar buttons to a macro, choose Macros from the Categories
list in the Commands tab of the toolbar customization dialog, and select the
macro on the right.

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


" wrote:

Hi,
I'd like to be able to add two shortcut buttons to the toolbar on a new
mail message. Instead of clicking on Options Request a read receipt
OR
Options Save sent items...etc
I'd like to be able to have a button right on the standard toolbar for
each of these two options. It may only save a couple clicks but every
click helps!

Can I do this with VBA since there doesn't appear to be an option in
the available shortcut buttons in "customize"?

It would also be nice to customize where the sent message will be saved
to rather than the default "sent items" folder.

Thanks.



 




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
Adding network folder shorcut as attachement to contact pdehondt Outlook - Using Contacts 1 July 10th 06 01:14 AM
Big Message Rule - Alternative Options? [email protected] Outlook - General Queries 2 May 13th 06 03:17 AM
create a shorcut on outlook to a folder on the system cluelessdynamite Outlook - General Queries 2 May 8th 06 02:08 PM
Adding button to New Message Window Joshua Ellul Add-ins for Outlook 5 March 22nd 06 01:10 PM
Outlook 2000 and Message Options window apragent Outlook and VBA 1 March 9th 06 06:39 AM


All times are GMT +1. The time now is 04:45 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.