Blog信息 |
blog名称:注册会计师(注会)练习软件 日志总数:398 评论数量:116 留言数量:27 访问次数:3270630 建立时间:2005年6月6日 |

| |
[delpih编程]delphi 对word编程的几个小体会 软件技术
吕向阳 发表于 2011/4/10 21:24:02 |
目前正在用delphi写一款excel表格转word文档的小软件,在写的过程中摸索到一些小技巧1)、 adoc.application.Selection.Borders.item(wdBorderVertical).LineStyle := wdLineStyleDot;比如原来的对象集Borders,就不能用borders(wdBorderVertical)表示其中的子对象,而应用Borders.item(wdBorderVertical)来表示。在delphi中的这个操作与vba中的是有明显区别的,与此类似的,还有如下 wordapp.ActiveDocument.Styles.item('自定标题').Font.Bold := True; wordapp.ListGalleries.item(wdNumberGallery).ListTemplates.item(1).ListLevels.item(1).NumberFormat := '%1.';这里面的styles,ListGalleries,ListTemplates等等。2)、wordapp.selection.style := '标题1';这语句有两个点在关注,第一点:selection是word.application对象的子对象,而不是document对象的子对象。第二点,选定对象设置为某种样式,直接等于该样式名就可以了,而不用vba里面类似的语句。 |
|
|