以前に作成した Word 2007 リボン セット (8 つのタブ、約 150 個のボタン、10 個のチェックボックス) を VS2005 で作成した VB から VS2010 の C# に変換しようとしています。私が抱えている問題は、マクロが有効になっているテンプレートを使用して、ボタンのコントロールを設定して新しいドキュメントを開くことができないことです。テンプレートごとに確認済みのファイル パスがあり、VB-C# トランスレータを使用しましたが、何らかの理由で正しく動作しません。これまでのところ、テンプレートをロードする方法として私が持っているものは次のとおりです。
private void _LoadTemplate(string templateName) { string templatePath1 = "//Macro - Development"; string templatePath2 = "//Macro - Development/Templates No Longer Updated"; if(File.Exists(templatePath1 + templateName)) { Document doc = Application.Documents.Add(Template = templatePath1 + templateName); } else if (File.Exists(templatePath2 + templateName)) { Document doc = Application.Documents.Add(Template = templatePath2 + templateName); } else { MsgBox = "Template does not exist."; }