p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Microsoft Office > Other Office > Visual Studio Tools for Office
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Visual Studio Tools for Office Be sure to specify which version you are working with.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio Tools for Office section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 26th, 2009, 04:12 AM
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation How can i add action on all active inspector

the below action working just on the first mail in inbox how can i customized it to work on all mail item
-----------------------------------------------------------------------------
Public Class ThisAddIn
Private WithEvents mailItem As Outlook.MailItem
Private WithEvents items As Outlook.Items


Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Startup

Dim ns As Outlook.NameSpace = Application.Session
Dim inbox As Outlook.MAPIFolder = ns.GetDefaultFolder( _
Outlook.OlDefaultFolders.olFolderInbox)

For Each o As Object In inbox.Items
If TypeOf o Is Outlook.MailItem Then
mailItem = o
Else
Exit For
End If
Next


AddHandler mailItem.CustomAction, AddressOf MailItem_CustomAction

Dim action As Outlook.Action = mailItem.Actions.Add()
action.Name = "My custom action"
action.ShowOn = Outlook.OlActionShowOn.olMenuAndToolbar
action.ReplyStyle = Outlook.OlActionReplyStyle.olLinkOriginalItem
'End If

End Sub

Private Sub MailItem_CustomAction(ByVal action As Object, _
ByVal response As Object, ByRef cancel As Boolean)


MessageBox.Show("Add mail")
mailItem.SaveAs("C:\Test.msg")
End Sub

End Class

---------------------------------------------------------------------
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 28th, 2009, 12:21 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HI

Just by using for or foreach loop

and inside the loop

Dim action As Outlook.Action = mailItem.Actions.Add()
action.Name = "vsto action 1"
... other properties
...

This will work ...

cheers!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add user to group - Active Directory anurag_ur ASP.NET 2.0 Professional 0 January 17th, 2006 02:54 AM
Add user to group - Active Directory anurag_ur ASP.NET 1.0 and 1.1 Professional 0 January 16th, 2006 09:25 AM
Add User to group - Active Directory anurag_ur .NET Framework 1.x 0 January 16th, 2006 09:15 AM
Add User to group - Active Directory anurag_ur C# 0 January 16th, 2006 09:13 AM
Add User to group - Active Directory anurag_ur ASP.NET 1.0 and 1.1 Basics 0 January 16th, 2006 09:13 AM



All times are GMT -4. The time now is 04:45 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc