使用C#有条件地设置单词样式 [英] Conditionally set style for word using C#

查看:87
本文介绍了使用C#有条件地设置单词样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在使用

Hi,


I am automating Word styling using

Microsoft.Office.Interop.Word;


使Word样式自动化
我迫切需要帮助.

例如.

如果该段如下所示(无任何数字纯文本),则需要设置一种样式

在强制性标准和建议的海上安全调查实践中使用以下术语时,它们具有以下含义.

如果该段落类似于另一种样式

2.1代理人是指代表船舶的所有人,租赁人或经营人或货物的所有人从事提供运输服务,包括管理作为船舶安全主体的船舶的管理安排的任何自然人或法人调查.

如果该段落类似于另一种样式

2.1.1代理人是指代表船舶的所有人,承租人或经营人或货物的所有人从事提供运输服务的自然人或法人,包括对作为船舶主体的船舶的管理安排海洋安全调查.

如果该段落类似于另一种样式

2.1.1.1代理人是指代表船舶的所有人,租船人或承运人或货物的所有人从事提供运输服务的自然人或法人,包括对作为船舶主体的船舶的管理安排海洋安全调查.

你能帮忙怎么做吗?

谢谢



I am in urgently in need of help.

for example.

If the paragraph is like below(with out any number-plain text) need to set one style

When the following terms are used in the mandatory standards and recommended practices for marine safety investigations they have the following meaning.

If the paragraph is like below another style

2.1 An agent means any person, natural or legal, engaged on behalf of the owner, charterer or operator of a ship, or the owner of the cargo, in providing shipping services, including managing arrangements for the ship being the subject of a marine safety investigation.

If the paragraph is like below another style

2.1.1 An agent means any person, natural or legal, engaged on behalf of the owner, charterer or operator of a ship, or the owner of the cargo, in providing shipping services, including managing arrangements for the ship being the subject of a marine safety investigation.

If the paragraph is like below another style

2.1.1.1 An agent means any person, natural or legal, engaged on behalf of the owner, charterer or operator of a ship, or the owner of the cargo, in providing shipping services, including managing arrangements for the ship being the subject of a marine safety investigation.

could you please help how to do this.

Thanks

推荐答案

看看Style ^ ]界面.
一些信息-文字样式自动化 [ http://cathalscorner.blogspot.in/2009/08/docx-v1008-released.html [
Have a look at the Style[^] interface.
Some info - http://blogs.southworks.net/ebella/2007/09/22/office-interop-attach-a-custom-template-and-update-styles-in-word-2007-using-c/[^]

In addition look at
Word Style Automation[^]

You can also look at a third party tool - http://cathalscorner.blogspot.in/2009/08/docx-v1008-released.html[^].


这篇关于使用C#有条件地设置单词样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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