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

Assigning macro to keyboard in Outlook



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 18th 08, 11:30 PM posted to microsoft.public.outlook.program_vba
R.U. Steinberg
external usenet poster
 
Posts: 2
Default Assigning macro to keyboard in Outlook

Thanks very much!

"Ken Slovak - [MVP - Outlook]" wrote:

You cannot assign a keyboard shortcut to the macro, nor will that code work
in Outlook.

For example, the macro has Selection with no qualifiers. For Outlook that
means an Explorer.Selection, which does not have a PasteAndFormat() method.
That code won't work at all.

Instead, you'd have to get the current selected item or open item, make sure
it's WordMail, instantiate a WordEditor object which is a Document object,
set the selection in the text, etc. It's not as simple as you seem to think.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"R.U. Steinberg" wrote in message
...
I recorded a simple macro in Word 2003 that I assigned to the keyboard as
Alt-V that pastes plain text (as opposed to formatted, RTF, or HTML text).

I want this same keyboard shortcut to work in Outlook. I understand
Outlook
does not have a macro recorder so I recorded it in Word.

The macro shows up in Outlook but I do not know how to make it function. I
dragged it to the Outlook toolbar--how do I assign it to the key (Alt-V)?

The code is as follows:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/17/2008
'
Selection.PasteAndFormat (wdPasteDefault)
End Sub



 




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
assigning tasks in outlook 2003 Matt Morris Outlook - General Queries 6 September 26th 07 04:48 PM
Assigning tasks in Outlook 2003 Terence Alva Outlook - General Queries 8 September 24th 07 12:36 PM
Outlook 2007: assigning keyboard shortcut to email editor macro Mikael Outlook and VBA 6 March 17th 07 06:42 PM
Outlook macro abends but Word macro runs successfully Jreue Outlook and VBA 0 December 13th 06 11:55 PM
Outlook 2000 Assigning Stationery?????? scooterlady Outlook - General Queries 1 September 23rd 06 07:16 PM


All times are GMT +1. The time now is 11:37 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-2025 Outlook Banter.
The comments are property of their posters.