Open XML - 使用 stylePaneFormatFilter 属性显示“正常”样式以及自定义样式和清晰的格式选项

发布于 2024-11-05 12:15:56 字数 602 浏览 5 评论 0原文

我想以编程方式对 Word 2007 文档进行更改,以便它只显示“正常”样式、用户创建的所有自定义样式以及样式窗格中的“清除格式”选项。

现在我可以显示自定义样式和清晰的格式选项,但不能显示普通样式。

来自:- http://msdn.microsoft.com/ fr-fr/library/documentformat.openxml.wordprocessing.stylepaneformatfilter.aspx

0x1000 - 指定应存在从文本中删除所有格式和样式的样式。 0x0002 - 指定仅具有 customStyle 属性的样式应显示在文档样式列表中。

我将上面的十六进制值相加得到 1002,以显示自定义样式和清除格式。 但我看不到一种显示“正常”风格的方法,因为这是内置的风格。但是,当您在任何段落上应用清晰格式时,默认情况下单词会应用普通样式。也就是说,用户希望看到“普通”风格。 :-(

有办法做到这一点吗?

I want to make changes programatically to the Word 2007 document so that It ONLY displays the "Normal" style, all the custom styles which user created and the "Clear formatting" option in the style pane.

Now I able to show the custom styles and the clear formatting option but not the Normal style.

From :- http://msdn.microsoft.com/fr-fr/library/documentformat.openxml.wordprocessing.stylepaneformatfilter.aspx

0x1000 - Specifies that a style should be present which removes all formatting and styles from text.
0x0002 - Specifies that only styles with the customStyle attribute should be displayed in the list of document styles.

I sum the hex values above to get 1002 to show both Custom Styles and the Clear Formatting.
But I dont see a way to show the "Normal" style as thats is built in style. However, when you apply clear formatting on any paragraph, by default word applied Normal style. That said, users want to see "Normal" style. :-(

Is there a way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文