Microsoft . 技术之路...

—— 专注于微软技术, 分享是快乐的源泉......
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

设置Word段落格式

Posted on 2006-07-25 11:27  赣江源  阅读(1018)  评论(0编辑  收藏  举报
Const CENTERED = 1

Set objWord = CreateObject("Word.Application")
objWord.Visible 
= True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

objSelection.ParagraphFormat.Alignment 
= CENTERED
objSelection.ParagraphFormat.LineSpacing 
= 36

objSelection.Font.Name 
= "Arial"
objSelection.Font.Size 
= "18"
objSelection.TypeText 
"Here is some text typed in. "
objSelection.TypeText 
"Here is some more text typed in. "
objSelection.TypeText 
"Here is even more text typed in. "
objSelection.TypeText 
"This is the last of the text."