-
Notifications
You must be signed in to change notification settings - Fork 0
/
ThisAddIn.cs
36 lines (30 loc) · 993 Bytes
/
ThisAddIn.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using Microsoft.Office.Interop.Visio;
using System.Windows.Forms;
namespace DragDropAddin
{
public partial class ThisAddIn
{
Form1 _form1 = new Form1();
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Application.Documents.Add("");
_form1.Show(NativeWindow.FromHandle((IntPtr)Application.Window.WindowHandle32));
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
_form1.Close();
}
#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
}
}