使用C#为word文档的标题编号 [英] Numbering the heading of word document using C#

查看:701
本文介绍了使用C#为word文档的标题编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#准备一个word文档。我正在使用Microsoft.Office.Interop.Word.I在编号段落时卡住了。



假设我有在word文档中打印如下。



1.标题1



有些文字在这里







1.1小标题1



some文字在这里







1.1.1子标题2



一些文字在这里







2.标题2



有些文字在这里







请帮帮我。我已经尝试了很多东西但是没能做到这一点。

I am preparing a word document using C#.I am using Microsoft.Office.Interop.Word.I got stuck while numbering the paragraphs.

Suppose I have to print like this in the word document.

1. Heading1

some text is here



1.1 Sub heading1

some text is here



1.1.1 Sub heading2

some text is here



2. Heading2

some text is here



Please help me. I have tried so many things but not able to do that.

推荐答案

选择合适的段落样式 - 不要明确编号。

有HeadingX样式。在那里定义编号方案(例如在normal.dotx中)。

干杯

Andi
Select the proper paragraph style - don''t number explicitly.
There are HeadingX styles. Define the numbering scheme there (e.g. in the normal.dotx).
Cheers
Andi


这篇关于使用C#为word文档的标题编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆