アドイン作成

テキストを走査する

備忘録も兼ねてPowerPointプレゼンテーション内のテキストを走査するためのクラスを作成しました。 走査する単位はCharacter, Run, Word, Line, Sentence, Pragraphから選択できます。 using PowerPoint = Microsoft.Office.Interop.PowerPoint; using Offic…

編集中のプレゼンテーション、スライドを取得する

using PowerPoint = Microsoft.Office.Interop.PowerPoint; public partial class ThisAddIn { PowerPoint.Presentation GetActivePresentation() { return this.Application.ActivePresentation; } PowerPoint.Slide GetActiveSlide() { return this.Applic…

選択中のスライド、シェイプを取得する

using PowerPoint = Microsoft.Office.Interop.PowerPoint; public partial class ThisAddIn { PowerPoint.Selection GetSelection() { try { return this.Application.ActiveWindow.Selection; } catch (System.Runtime.InteropServices.COMException exc) …

VSTOファイルのパスを取得する

レジストリに登録されている情報を利用して.vstoファイルのパスを取得する方法。 private const string REGKEY_ADDIN = @"Software\Microsoft\Office\PowerPoint\AddIns\MyPowerPointAddIn"; string GetVstoFilePath() { Microsoft.Win32.RegistryKey regkey…

アドインのインストーラを作成する

アドインプロジェクトの変更 インストーラを作成したアドインプロジェクトを開きます。ここではMyPowerPointAddInプロジェクトとします。[1]http://code.msdn.microsoft.com/VSTO3MSI/Release/ProjectReleases.aspx?ReleaseId=729リンク[1]からVSTO v3 Deplo…

無効なアプリケーションアドインからの復帰

作成しているアドイン内で例外が生じた場合や、デバッグ中にVisual Studio側からでバグを停止したりすると、アドインが無効にされてしまいます。[1]How to: Re-enable a VSTO Add-in that has been disabled - Visual Studio | Microsoft Docs詳しくは[1]に…

何もしない空のPowerPointアドインの作成

アドインの中身は後々追加するとして、とりあえず何もしないPowerPointアドインを作成します。 Visual Studioで新規プロジェクトを作成します。 PowerPoint2007アドインを選択します。 ここではC#で選択しますが、VB.NETでも同様だと思います。 アドイン名は…

VSTOでPowerPointのCOMアドインを作成する

VSTO(Visual Studio Tools for Office)を使用するとVisual StudioでMicrosoft Officeようのアドインを作成することができます。VBAではなくC#、VB.NETを使用できます。VSTOでPowerPointのCOMアドインを作成した備忘録を少しずつ書いていきます。 間違った方…