![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hello everybody!!
I created a new button in the context menu (http://www.outlookcode.com/codedetail.aspx?id=314) and so I wanted to save the selected mail to the harddisk. I found some code snipes like that: ' ### first find the selected item ### Dim objApp As Application Dim objItem As Object Dim objSelection As Selection Dim intMaxItems As Integer intMaxItems = 5 Set objApp = CreateObject("Outlook.Application") Set objSelection = objApp.ActiveExplorer.Selection Select Case objSelection.Count Case 0 MsgBox "No items were selected" Case Is intMaxItems MsgBox "Too many items were selected" Case Else 'objSelection.Item End Select To save a mail I should use the mailItem-Object, but this only shows how to save an new mail: Dim myItem As Outlook.Inspector Dim objItem As Object Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.ActiveInspector If Not TypeName(myItem) = "Nothing" Then Set objItem = myItem.CurrentItem strname = objItem.Subject 'Prompt the user for confirmation objItem.SaveAs "C:\" & strname & ".txt", olTXT End If Else MsgBox "There is no current active inspector." End If Now I want to merge these two code snipets, but I have no idea how to manage it! Has anybody an idea how I can save the selected mail by right-Clicking in the context-menu? Thank you for your help!!! Walter. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Saving mail (.msg) after clicking context menu button | davemode | Outlook and VBA | 1 | June 12th 06 05:59 PM |
Can't access contacts list when clicking on To button in new email | John M, | Outlook - Using Contacts | 3 | May 26th 06 01:42 PM |
adding a context menu in Outlook | donald | Add-ins for Outlook | 6 | May 3rd 06 01:49 PM |
How do I add a new option in the context menu(Outlook)? | Outllok - context menus aad ins | Outlook - Using Forms | 5 | March 16th 06 02:47 PM |
Context Menu not present | Mono | Outlook Express | 5 | February 7th 06 06:22 PM |