Add Formatted Text to a Word Document
发布时间:2016-12-30 来源:查字典编辑
摘要:DemonstrationscriptthatdisplaysformatteddatainaMicrosoftWorddocument.复...
DemonstrationscriptthatdisplaysformatteddatainaMicrosoftWorddocument.
复制代码 代码如下:
SetobjWord=CreateObject("Word.Application")
objWord.Visible=True
SetobjDoc=objWord.Documents.Add()
SetobjSelection=objWord.Selection
objSelection.Font.Name="Arial"
objSelection.Font.Size="18"
objSelection.TypeText"NetworkAdapterReport"
objSelection.TypeParagraph()
objSelection.Font.Size="14"
objSelection.TypeText""&Date()
objSelection.TypeParagraph()