PC Review


Reply
Thread Tools Rate Thread

Assigning shortcut keys, getting selected text and distributing macros in Outlook

 
 
Amir
Guest
Posts: n/a
 
      21st Aug 2005
Hi,

I'm looking for a way to do the following 3 actions using VBA / VB in
Outlook:
(I'm using Office 2000 Proffessional)

1. Assign a shortcut key to a macro in Outlook.

In Word I would have used something like:

Dim kbNew As KeyBinding
Set kbNew = KeyBindings.Add(KeyCategory:=wdKeyCategoryCommand, _
Command:="MyMacroName", KeyCode:=BuildKeyCode(wdKeyControl,
wdKeyAlt, wdKeyA))

But how can I do that in Outlook?

2. Getting the current selected text. I mean the text which I select with
the mouse in the preview of the current mail. In Word I would have used:
Selection
to get the current selected text. What is the equivalent in Outlook for the
current selected text in the active mail message preview?

3. How can I distribute macros in Outlook? In Word I would have put the .dot
template in the users' C:\Documents and Settings\Application
Data\Microsoft\Word\Startup Directory, so that the template was loaded each
time Word starts. In Outlook, there are no templates, so how can I
distribute the macros to other users?

I know VBA and a bit of VB.

Kind Regards,
Amir.


 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      22nd Aug 2005
1. You can't. You would have to assign the macro to a button you add to a
toolbar or menu.

2. You can't. Selected text in the preview pane is not accessible to your
code.

3. Distributing macros is done by distributing the entire VBAProject.OTM
file, which wipes out any macros the user already has, since you must
overwrite their existing file.

The best way to do what you want for distribution is to write a COM addin.
It's more code but more easily distributable and maintainable.

See http://www.outlookcode.com/d/comaddins.htm for information about COM
addins.

See http://www.outlookcode.com/d/distributevba.htm for information about
distributing VBA code.

See http://support.microsoft.com/?kbid=252426 for information about how to
call a macro from a toolbar button you create.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Amir" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'm looking for a way to do the following 3 actions using VBA / VB in
> Outlook:
> (I'm using Office 2000 Proffessional)
>
> 1. Assign a shortcut key to a macro in Outlook.
>
> In Word I would have used something like:
>
> Dim kbNew As KeyBinding
> Set kbNew = KeyBindings.Add(KeyCategory:=wdKeyCategoryCommand, _
> Command:="MyMacroName", KeyCode:=BuildKeyCode(wdKeyControl,
> wdKeyAlt, wdKeyA))
>
> But how can I do that in Outlook?
>
> 2. Getting the current selected text. I mean the text which I select with
> the mouse in the preview of the current mail. In Word I would have used:
> Selection
> to get the current selected text. What is the equivalent in Outlook for
> the current selected text in the active mail message preview?
>
> 3. How can I distribute macros in Outlook? In Word I would have put the
> .dot template in the users' C:\Documents and Settings\Application
> Data\Microsoft\Word\Startup Directory, so that the template was loaded
> each time Word starts. In Outlook, there are no templates, so how can I
> distribute the macros to other users?
>
> I know VBA and a bit of VB.
>
> Kind Regards,
> Amir.
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning shortcut keys Island Girl Microsoft Word New Users 4 8th Dec 2007 05:40 PM
assigning keyboard shortcut keys =?Utf-8?B?aGJlYXI=?= Microsoft Access Macros 2 19th Jul 2006 07:13 PM
Assigning Keys for Macros =?Utf-8?B?V2ViZm9yZA==?= Microsoft Word Document Management 1 3rd Aug 2005 10:01 PM
assigning shortcut keys for macros in powerpoint. =?Utf-8?B?QW5pbCBLdW1hcg==?= Microsoft Powerpoint 5 23rd Feb 2005 04:31 PM
assigning shortcut keys to marcos =?Utf-8?B?U3VkaGFrYXJhLlQuUC4=?= Microsoft Powerpoint 3 18th Feb 2005 03:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:03 PM.