|
|
 |
| 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.
|
 |

September 2nd, 2009, 02:55 AM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

September 2nd, 2009, 04:26 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2005
Location: , , .
Posts: 420
Thanks: 0
Thanked 14 Times in 14 Posts
|
|
Hi
Can you try using Application.Item_Send event
Regards
Sundar
|

September 5th, 2009, 06:22 AM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

September 5th, 2009, 11:08 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2005
Location: , , .
Posts: 420
Thanks: 0
Thanked 14 Times in 14 Posts
|
|
|

September 6th, 2009, 03:17 AM
|
|
Registered User
|
|
Join Date: Sep 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
}
}
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |