Add Formatted Text to a Word Document_javascript技巧
程序员文章站
2022-03-26 13:01:22
...
Demonstration script that displays formatted data in a Microsoft Word document.
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
objSelection.Font.Name = "Arial"
objSelection.Font.Size = "18"
objSelection.TypeText "Network Adapter Report"
objSelection.TypeParagraph()
objSelection.Font.Size = "14"
objSelection.TypeText "" & Date()
objSelection.TypeParagraph()
复制代码 代码如下:
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
objSelection.Font.Name = "Arial"
objSelection.Font.Size = "18"
objSelection.TypeText "Network Adapter Report"
objSelection.TypeParagraph()
objSelection.Font.Size = "14"
objSelection.TypeText "" & Date()
objSelection.TypeParagraph()
推荐阅读
-
Add a Picture to a Microsoft Word Document_javascript技巧
-
Add a Picture to a Microsoft Word Document_javascript技巧
-
Add a Table to a Word Document_javascript技巧
-
Open and Print a Word Document_javascript技巧
-
Open and Print a Word Document_javascript技巧
-
Add Formatted Text to a Word Document_javascript技巧
-
Add a Table to a Word Document_javascript技巧
-
Add Formatted Data to a Spreadsheet_javascript技巧
-
Add Formatted Data to a Spreadsheet_javascript技巧
-
Add a Formatted Table to a Word Document_javascript技巧