在C/S下,用一个操作将该文档导出为word文档。我用想用vba实现这个功能,可是标题写进去以后不能够居中,总不能连个标题都没有吧。
具体代码如下:
Set wordApp = createobject("Word.Application")
Set wordDoc = wordApp.documents.add()
wordApp.visible = True
Dim myRange As Variant
Set myRange = wordDoc.Range(0,0)
With myRange
.insertparagraph
.bold = True
.insertBefore "Title"
.paragraphFormat.Alignment = wdAlignParagraphCenter
End With
其中.paragraphFormat.Alignment = wdAlignParagraphCenter是将MyRange这个Range段落格式设为居中,可是怎么在notes中怎么不起作用呢?
.paragraphFormat.Alignment = 3
试试