Word 2010 中添加了新样式(标题 1 + 非粗体)
在 Word 2010 中,新样式是自动创建的,我想禁止这种行为。 例如:格式化后样式为“标题1”的文本说ctrl+B删除粗体,Word创建一个名为“标题1+非粗体”的新样式
实际上我想在应用程序级别从VSTO切换这种行为。 有任何帮助吗?
In Word 2010 the new styles are created automatically, I would like to suppress this behaviour.
For eg: the text with style "Heading 1" after formatting say ctrl+B to remove the bold, the Word creates a new style called "Heading 1 + Not Bold"
Actually I want to switch oof this behaviour from VSTO at application level.
Any help would be appreciated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
实际上,Word 并不是创建新样式,而是显示(在样式窗格中)也具有直接格式设置(即应用样式后应用的格式设置)的样式。样式窗格底部的选项链接将显示以下对话框,其中包含样式显示选项:
要关闭通过 VBA 直接格式化的显示(可以根据您使用的语言对 VSTO 进行调整):
此外,还可以使用
FormattingShowFilter
属性控制显示哪些样式。例如,仅显示活动文档中使用的样式:希望这会有所帮助。
Actually, Word is not creating new styles but is displaying (within the Styles Pane) styles that also have direct formatting (which is formatting applied after the application of a style). The Options link on the bottom of the Styles Pane will display the below dialog box, which contains the style display choices:
To turn off the display of direct formatting via VBA (which can be adapted for VSTO depending on the language you are using):
Additionally, one can control which styles are displayed with the
FormattingShowFilter
property. For example, to only display the styles in use in the active document:Hope this helps.
您还可以在“样式窗格选项”对话框中取消选中“段落级格式设置”。关闭字体和段落的“格式化显示”是我使用Word的唯一方法。否则,多个作者添加的直接格式会掩盖您真正想要的样式。
You might also uncheck "paragraph level formatting" in the Style Pane Options dialog box. Turning off both font and paragraph "formatting to show" is the only way I can use Word. Otherwise, the direct formatting added by multiple authors obscures the styles you really want.
提供的答案会影响显示,但不会影响 Word 的根本行为。如果您想在应用程序级别抑制此行为,请将“应用程序”选项的“跟踪格式设置”设置为关闭(“工具”>“选项”>“高级”>“编辑选项”>“跟踪格式设置”。)。
The answers provided affect the display, but not the root behaviour of Word. If you want to suppress this behaviour at the application level set the Application option to Keep Track of Formatting to off (Tools > Option > Advanced > Editing Options > Keep track of formatting.).
文件/选项/校对/自动更正选项...(按钮)/键入时自动套用格式(选项卡)/取消选中根据格式定义样式
File / Options / Proofing / Auto Correct Options... (button) / AutoFormat As You Type (tab) / uncheck Define styles based on your formatting