私はVSTOプロジェクトに取り組んでおり、以下のコードのように、非表示モードでWordダイアログボックスを使用したいと考えています。
MSDNのコード
dynamic dialog = Application.Dialogs[Word.WdWordDialog.wdDialogFilePageSetup];
dialog.PageWidth = "3.3\"";
dialog.PageHeight = "6\"";
dialog.TopMargin = "0.71\"";
dialog.BottomMargin = "0.81\"";
dialog.LeftMargin = "0.66\"";
dialog.RightMargin = "0.66\"";
dialog.HeaderDistance = "0.28\"";
dialog.Orientation = "0";
dialog.DifferentFirstPage = "0";
dialog.FirstPage = "0";
dialog.OtherPages = "0";
// Apply these settings only to the current selection with this line of code:
dialog.ApplyPropsTo = "3";
// Apply the settings.
dialog.Execute();
別の診断を実装したいのですwdDialogEditFind
が、メソッドとプロパティが不明です。次に、リフレクションを使用してそれらを取得します(遅延バインディング)。しかし、有用な方法は見つかりませんでした。
Word.Dialog dlg = this.Application.Dialogs[Word.WdWordDialog.wdDialogEditFind];
System.Type t = dlg.Type.GetType();
System.Reflection.MemberInfo[] memInfo = t.GetMembers();
string str = "";
foreach (System.Reflection.MemberInfo m in memInfo)
str += m.Name + "\n";