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 2nd, 2009, 02:55 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
Default Run code when click send using VSTO 2008

How can i run code using VSTO 2008 when click on send button in Outlook mail 2207 to perform specific action like add attachment, add To ...etc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 2nd, 2009, 04:26 AM
Friend of Wrox
Points: 1,449, Level: 15
Points: 1,449, Level: 15 Points: 1,449, Level: 15 Points: 1,449, Level: 15
Activity: 17%
Activity: 17% Activity: 17% Activity: 17%
 
Join Date: Sep 2005
Location: , , .
Posts: 420
Thanks: 0
Thanked 14 Times in 14 Posts
Default

Hi

Can you try using Application.Item_Send event

Regards
Sundar
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old September 5th, 2009, 06:22 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
Default

thx a lot about reply, but how can i create custom button to save attachment in selected mail..

in other hand how can i deal with existed mail in outlook folder like:

save attachment, read mail info ... etc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old September 5th, 2009, 11:08 PM
Friend of Wrox
Points: 1,449, Level: 15
Points: 1,449, Level: 15 Points: 1,449, Level: 15 Points: 1,449, Level: 15
Activity: 17%
Activity: 17% Activity: 17% Activity: 17%
 
Join Date: Sep 2005
Location: , , .
Posts: 420
Thanks: 0
Thanked 14 Times in 14 Posts
Default

Hi

You can try creating a TaskPane in VSTO for having the button (http://www.add-in-express.com/add-in-vsto/task-pane.php and http://msdn.microsoft.com/en-us/magazine/cc163373.aspx)

You can iterate through the folders to get necessary information (http://www.packtpub.com/article/micr...-c-sharp-part1

http://vbadud.blogspot.com/2008/04/c...older-for.html

)

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old September 6th, 2009, 03:17 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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Outlook = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;
// Namespace reference for message box
using System.Windows.Forms;


namespace Outlook_Mailitem_But
{
public partial class ThisAddIn
{

Office.CommandBar PacktCustomToolBar;
// Declare the button
Office.CommandBarButton PacktButtonA;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
// Verify the PacktCustomToolBar exist and add to the application
if (PacktCustomToolBar == null)
{
// Adding the commandbar to Active explorer
Office.CommandBars PacktBars = this.Application.
ActiveExplorer().CommandBars;
// Adding PacktCustomToolBar to the commandbars
PacktCustomToolBar = PacktBars.Add("NewTestToolBar",
Office.MsoBarPosition.msoBarTop, false, true);
}
// Adding button to the custom tool bar
Office.CommandBarButton MyButton1 = (Office.
CommandBarButton)PacktCustomToolBar.Controls.Add(1 ,
missing, missing, missing, missing);
// Set the button style
MyButton1.Style = Office.MsoButtonStyle.msoButtonCaption;
// Set the caption and tag string
MyButton1.Caption = "Test BUTTON";
MyButton1.Tag = "MY BUTTON";
if (this.PacktButtonA == null)
{
// Adding the event handler for the button in the toolbar
this.PacktButtonA = MyButton1;
PacktButtonA.Click += new Office.
_CommandBarButtonEvents_ClickEventHandler(ButtonCl ick);
}
}
// Button event in the custom toolbar
private void ButtonClick(Office.CommandBarButton ButtonContrl,
ref bool CancelOption)
{
// Message box displayed on button click
MessageBox.Show(ButtonContrl.Caption + " This Is Test Button!");
// How can i write code here to access selected mail item
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}

#region VSTO generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}

#endregion
}
}
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
Visual studio 2005(32 bit) code not work in visual studio 2008 on windows server 2008 gr8.jain Visual Basic 2008 Essentials 1 August 31st, 2009 11:07 AM
Folder Listing 13-04: How to run the XML file from VS 2008 cJeffreywang BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 July 7th, 2009 11:56 AM
SQL 2008 will not run on Windows 2008? dkrus Book: Professional Microsoft SQL Server 2008 Administration ISBN: 978-0-470-24796-9 1 February 23rd, 2009 12:34 PM
Word Templates and VSTO, send Docs by Mail pblanchard BOOK: Professional VSTO 2005 ISBN: 0-471-78813-9 1 October 23rd, 2007 08:12 PM
Word Templates and VSTO, send Docs by Mail pblanchard Visual Studio Tools for Office 1 July 15th, 2007 04:26 PM



All times are GMT -4. The time now is 06:50 AM.


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