VB.net Word Automation Doco样式修改 [英] VB.net Word Automation doco styles modification

查看:108
本文介绍了VB.net Word Automation Doco样式修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要修改单词样式标题1等上的编号,以便标题显示为
2.标题1
2.1标题2,依此类推

我已经设法了解如何将模板文件(.dot)与自动化文档相关联
作为Word.Document的公共oDoc
oDoc = oWord.Documents.Add(CurPath +"\ Resources \ SCX.dot")

然后将样式与段落相关联,但这仅是
Word段落的公共oParagraph
oPara.Range.Style =标题1"
到目前为止,我发现的关于Word Automation的所有内容都是通过互联网搜索得到的,任何人都可以推荐一本有关Word Automation的书,我似乎可以找到一本书.

非常感谢
Rod

Hi
I have a need to modify the Numbering on the Word Styles Heading 1 etc so that the heading reads
2. Heading 1
2.1 Heading 2 and so on

I have managed to understand how to associate a template file (.dot) with my automated document
Public oDoc As Word.Document
oDoc = oWord.Documents.Add(CurPath + "\Resources\SCX.dot")

and then to associate a style with a paragraph, but thats as far as it goes
Public oPara As Word.Paragraph
oPara.Range.Style = "Heading 1"
All that I have found out about Word Automation so far is what I have found by searching the internet, can anyone recommend a book of Word Automation, I can seem to locate one.

Many thanks
Rod

推荐答案

将oPara1用作Word.Paragraph

oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text =标题1"
oPara1.Range.Font.Bold = True
oPara1.Format.SpaceAfter = 24''段落后的24 pt间距.
oPara1.Range.InsertParagraphAfter()
Dim oPara1 As Word.Paragraph

oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "Heading 1"
oPara1.Range.Font.Bold = True
oPara1.Format.SpaceAfter = 24 ''24 pt spacing after paragraph.
oPara1.Range.InsertParagraphAfter()


这篇关于VB.net Word Automation Doco样式修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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