PPT按插件

2017-12-07  本文已影响0人  Lucky_ce60

首先在按插件之前,我们需要做的是:

开始以下步骤操作:

选择
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Text;
using System.Xml.Linq;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace demo1
{
    public partial class ThisAddIn
    {
        int a = 0;
        void Application_SlideShowBegin(SlideShowWindow Wn) // 开始播放
        {
            MessageBox.Show("hello.");
        }
        void Application_SlideShowNextSlide(SlideShowWindow Wn) //翻页播放
        {
            a++;
            String str = String.Format("no. {0}", a);
            MessageBox.Show(str);
        }
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            this.Application.SlideShowBegin += new EApplication_SlideShowBeginEventHandler(Application_SlideShowBegin);
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {
            this.Application.SlideShowNextSlide += new EApplication_SlideShowNextSlideEventHandler(Application_SlideShowNextSlide);
        }

        #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
    }
}

出现加载项就说明已成功运行,简单的小插件就好了!

上一篇 下一篇

猜你喜欢

热点阅读