Creating a menu or command button in Outlook

  • Thread starter Thread starter salad
  • Start date Start date
S

salad

I was wondering if it is possible to put a command button or menu item
in Outlook. The caption read something like "File It". Then when
someone has an email to be filed, they press the button and it moves
that message to a specified folder that will be a public/shared folder.
There will never be more than that one folder and will always be a
specified name.

If it can be done, would it be pretty easy to create? And once created,
can the code to do the process be distributed easily to other users of
Outlook? IOW, are there installation scripts that need to be created
for putting it on each users machine?
 
It sounds like you have little programming experience, so this may be a
challenge for you. But what you want to do is fairly easy. All macros that
you code in Outlook can be mapped to a custom button. And the code to move
an item basically involves:

- capturing the selection with the Explorer.Selection object
- setting a MAPIFolder reference to the desired folder by using the Folders
collection
- calling Item.Move to move the message

However, macros cannot be easily distributed to many users. See this page
for more info:

Distributing Microsoft Outlook VBA Code:
http://www.outlookcode.com/d/distributevba.htm

Ideally, you would need a professional developer to write the code as a COM
Add-In, which can be easily distributed with a setup package.
 
Eric said:
It sounds like you have little programming experience, so this may be a
challenge for you.

Yes and no. Over 20 years programming but 0 minutes programming Outlook.

But what you want to do is fairly easy. All macros that
you code in Outlook can be mapped to a custom button. And the code to move
an item basically involves:

- capturing the selection with the Explorer.Selection object
- setting a MAPIFolder reference to the desired folder by using the Folders
collection
- calling Item.Move to move the message

However, macros cannot be easily distributed to many users. See this page
for more info:

Distributing Microsoft Outlook VBA Code:
http://www.outlookcode.com/d/distributevba.htm

Ideally, you would need a professional developer to write the code as a COM
Add-In, which can be easily distributed with a setup package.
Thanks for the link. I should think that process to create the function
would be minimal, the distribution process a potential headache. I'd
not like to overwrite somebody's existing macros.

Good advice.
 
Eric said:
It sounds like you have little programming experience, so this may be a
challenge for you. But what you want to do is fairly easy. All macros that
you code in Outlook can be mapped to a custom button. And the code to move
an item basically involves:

Hi Eric. Instead of reinventing the wheel I believe the Outlook
Organizer Pane will do exactly what I need to do. I wouldn't have to
distribute anything except provide instructions on how to open the
Organizer window, maybe put it on their standard toolbar if it doesn't
already reside there.

I guess you could say I'm a newbie regarding Outlook and haven't fully
explored it's capabilites.

Again, thanks for the link and info you provided.
 
It could actually be a lot easier than using the Organizer feature - the
"Move to Folder" button rememebers the last 10 folders you've moved an item
to. Just do it once and you'll most likely never have to browse to the
folder very often. However, I still use a "Move To Projects Folder"
button/macro for those instances where I'm too darn lazy to select the folder
if I so happened to have moved previous items to 10 other folders in the
interim.

We developers of course love to overthink things and do it the hard way, but
I'm sure your users would be more than happy with the existing feature - no
code, no mess!
 
Eric said:
It could actually be a lot easier than using the Organizer feature - the
"Move to Folder" button rememebers the last 10 folders you've moved an item
to. Just do it once and you'll most likely never have to browse to the
folder very often. However, I still use a "Move To Projects Folder"
button/macro for those instances where I'm too darn lazy to select the folder
if I so happened to have moved previous items to 10 other folders in the
interim.

We developers of course love to overthink things and do it the hard way, but
I'm sure your users would be more than happy with the existing feature - no
code, no mess!
That's me. I have no idea how many people will be using my application
that connects to and manipulates Outlook emails. I'd sooner have them
use something exisiting and prebuilt in Outlook and support other issues
in my application bound to come up.

That being said, I'd like to learn more about Outlook. Someday I may be
be able to contribute some words of wisdom to other seeekers or
knowledge. I ordered Sue's book today, that should get me started.
 
Yup, Sue's book is the perfect way to start. Her Outlook 2007 programming
book will also be out very shortly as well (disclosure - I edited it).
 
Back
Top