【问题标题】:Check which template was used to create Excel workbook检查用于创建 Excel 工作簿的模板
【发布时间】:2012-02-16 20:23:01
【问题描述】:

是否可以检查特定模板是否用于创建工作簿?

一句话,我有一段代码:

string templateUsed = document.get_AttachedTemplate().FullName;

var templateName = document.BuiltInDocumentProperties[Microsoft.Office.Interop.Word.WdBuiltInProperty.wdPropertyTemplate].Value.ToString();

如果只在我的模板上工作,我想执行一段代码,例如:

workbook.Theme.ThemeColorScheme.Load("PathToMyColors.xml");

【问题讨论】:

    标签: vsto


    【解决方案1】:

    试试这个 Globals.ThisAddIn.Application.TemplatesPath 类似的问题here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多