首页 > 解决方案 > 使用 VB.net 打开所有格式标记可见的 Word 文档

问题描述

我正在 Visual Studio 环境中使用 VB 将 Word 自定义功能区构建为 VSTO 项目。我想做的部分事情是,从功能区打开 Word 文档:

我以前使用 VBA 作为“打开”事件来完成此操作。我使用了以下内容:

'Open Word with Styles pane visible and docked to the right
     With Application
         .TaskPanes(wdTaskPaneFormatting).Visible = True
         .CommandBars("Styles").Position = msoBarRight
     End With
     ActiveWindow.DocumentMap = True
    
 'Open document with all formatting and hidden text visible
     ActiveWindow.View.ShowAll = True

我一直在寻找几个小时,无法找到如何使用 VB.net 做到这一点。

请问有人能帮忙吗。

标签: vb.netvstoword

解决方案


推荐阅读