Google Search

Google
 

Tuesday, June 3, 2008

Video: How Do I: Customize Outlook Item Context Menus?

Presenter:Steve Hansen

Learn how to customize Outlook item context menus by creating a simple Outlook add-in that helps you organize your email items.


The following text is a software generated transcript of the video. Click on a minute link to jump to a location within the video

Minute 0

Hogmanay misting handsome officer com as it was on a customize Outlook context menus communities in today s trading and I would have been that uses context menus and allows you using the context menu to take in e mail and and create a folder based on the domain of the sender e mail in another folder inside a domain based on the sender of the e mail you can do this by right clicking on an item in an Explorer window and choosing send to domain folder suffered a look at an and done a few things you already just a few class level variables want to hold the current
Minute 1

Mail item with little button with some going to place in the context menu and those of you in a couple of event handlers for the context menu close an item context menu display these are the two event handlers and its use in order to manipulate the context menu item context menu in particular here so for a helper method I ve got a good message class function in Wisconsin was going to use reflection to get the message class associated with an item in Outlook this will trigger things about how development is that so many of the items that are returned by various public methods or Outlook properties are typed as objects rather than strongly typed this in the mail item archive
Minute 2

Item you just didn t item was allowed to suck a big message class using reflection to retrieve the message class of and Outlook object so would be to message class completed in the item context menu display event handler I m going to get the message class associated with the first item in the selection object dislikes about that can be one or more items are selected in an Explorer window for simplicity sake I m only going to handle the scenario where the first item selected is I cannot know and
Minute 3

Only got one item selected some use GetMessage class to figure out what the message class is what it s like to not come to town with both of those are true then I m going to create the button on the context menu splitting legal phase of our check to see as I cannot know in going to convert that to an Outlook mail item that I m going to Craig button on the command are so any item context menu display event handler a command bar is the context menus can be displayed in the meat of the selection object which represents the items that are selected when the user right clicks to show the context menu suffered botanists at the Jackson and then set the button to be visible stubbed in a button click event
Minute 4

And I can have a hammer to the button and passing the address of my blood and button click event handler subcompact to button click below and around 6 million close event when he wanted to hear this is really free and Mia and the items I used in the process of showing the context menu so messed up my item variable to reference nothing minute remove the event handler and set the button to nothing so button click event need to do a few things were going to do is get the meaning of the
Minute 5

He send her e mail address is I heard to have this handle the event where are the sender e mail address is not for the sender e mail type is not a good exchange server e mail so the personnel do is is greatly greater male item variable called item convert the first item in the selection to be a male item and then look to see if the sender e mail type of the item is not equal to the ex witches for exchange system
Minute 6

Doesn t come from exchange will create a string array called parts and then using the single you out as property am going to use these split method with the so that should give me that the sender name as one item and then the sender e mail domain is another item minimum set my estimate and verbal to be the last item in that park s array and I will return the assuming variable
Minute 7

So a great is domain very well in Lebanon click event handler is set equal to the result of the get the main call them assuming that I didn t factor the main back from that get the main call will create a domain folder until set to be an Outlook folder and nobody knew a couple more couple more items in a function called create folder and when you do in this function is a couple of things I will return an Outlook folder and I will create a folder but before the folder is created
Minute 8

And make sure the folder doesn t already exist if it does already exist on Justin returned the folder that already exists rather than create a new duplicate folder so migrate older procedure and require him folder so the folder where of the new folder should be created underneath as a child passing the name passing the type of folder in the URL if you want to turn the reviews the web view on the folder some other form from that trade is called to folder
Minute 9

Is still used by Minnesota public cells are only for internal use here so it s in the solar procedure is is going to lead to retrieve a fuller given a name and a parent folder if it doesn t exist it will return nothing by this activity and older procedure
Minute 10

And created a will were very cool called fool are using an older procedure to see if neither filler that I would like to create art exists so that doesn t exist in an uneasy at method to add a new folder with a given name and folder type and then assuming that I do have a folder now and that there is a valid URL parameter passed them of going to suck the review URL of the folder equal to
Minute 11

The URL that was passed in and turn on the web do I know this return the folder back to the calling procedure final thing to do is to flush out the button click event handler so for my domain holder since I got an e mail from Joe Microsoft com domain holders can it be a folder called Microsoft com and in my inbox and I ll use my great folder method for that so assuming here would be Microsoft com for full
Minute 12

Type will be folder inbox and then the URL will be a CTP welcome can t make that with estimating which would be Microsoft com in this example lets you want to do it is the reference to the current item is selected some of the use application that active explorer selection take the first item in the selection and convert that to an Outlook mail item if you create a folder in the folder variable for the sender sent him back if I got Joe an e mail from Joe and myself com or make sure I ve got a much off the account holder and a mimicry
Minute 13

Other floral underneath that for Joe and that ultimately where like to move by e mailing them to so use the create folder method in passing in the domain folder now is the parent using the item that s in the name for the name of the folder could be another inbox site folder and then I can use a URL the URL traversal does it in an empty string if no use the move method to move the current item into my centerfold or small remnants now Friday right click an item here I see my context menu items to domain folder or click that and
Minute 14

8 Mbytes again aol com folder and in a folder for Scott Thompson s EPA sovereign again on a different one for good and you can see that it was learned that her for days to the sender of e mail address that closes and how to use Outlook context menus thanks for a great day

Click here to go to original video page



No comments: