【问题标题】:Making a custom bookmark editor in Word 2010 with C# Add-In使用 C# 插件在 Word 2010 中制作自定义书签编辑器
【发布时间】:2017-05-19 22:04:03
【问题描述】:

我正在关注这个 MSDN 演练:https://msdn.microsoft.com/en-us/library/5eef9s6f.aspx

但我收到了一条错误:

Document extendedDocument = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);

错误是应用程序上的红色下划线,内容为:

'MyRibionAddin.MyRibbon does not contain a definition for 'Application' and no extension method 'Application' accepting a first argument of type 'MyRibionAddIn.MyRibbon' could be found ( are you missing a using directive or an assembly reference?)

【问题讨论】:

    标签: c# word-2010


    【解决方案1】:

    替换为

     Document extendedDocument = Globals.Factory.GetVstoObject(Globals.ThisAddIn.Application.ActiveDocument);
    

    它可以工作

    【讨论】:

      猜你喜欢
      • 2014-02-05
      • 1970-01-01
      • 1970-01-01
      • 2016-12-25
      • 2011-06-22
      • 1970-01-01
      • 2022-01-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多