一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

用jscript實現新建和保存一個word文檔

Demonstration script that retrieves NETwork adapter data from a computer, 
displays that data in a Microsoft Word document, and then saves the 
document as C:/Scripts/Word/Testdoc.doc. 
復制代碼 代碼如下:
Set objWord = CreateObject("Word.Application")
objWord.Caption = "Test Caption"
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()
objSelection.TypeParagraph()

objSelection.Font.Size = "10"

strComputer = "."
Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/cimv2")
Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_NETworkAdapterConfiguration")

For Each objItem in colItems

    objSelection.Font.Bold = True
    objSelection.TypeText "ARP Always Source Route: " 
    objSelection.Font.Bold = False
    objSelection.TypeText "" & objItem.ArpAlwaysSourceRoute
    objSelection.TypeParagraph()

    objSelection.Font.Bold = True
    objSelection.TypeText "ARP Use EtherSNAP: "
    objSelection.Font.Bold = False
    objSelection.TypeText ""  & objItem.ArpUseEtherSNAP
    objSelection.TypeParagraph()

    objSelection.Font.Bold = True
    objSelection.TypeText "Caption: "
    objSelection.Font.Bold = False
    objSelection.TypeText ""  & objItem.Caption
    objSelection.TypeParagraph()

    objSelection.Font.Bold = True
    objSelection.TypeText "Database Path: "
    objSelection.Font.Bold = False
    objSelection.TypeText ""   & objItem.DatabasePath
    objSelection.TypeParagraph()

    objSelection.Font.Bold = True
    objSelection.TypeText "Dead GW Detection Enabled: "
    objSelection.Font.Bold = False
    objSelection.TypeText ""   & objItem.DeadGWDetectEnabled
    objSelection.TypeParagraph()

    objSelection.Font.Bold = True
    objSelection.TypeText "Default IP Gateway: " 
    objSelection.Font.Bold = False
    objSelection.TypeText "" & objItem.DefaultIPGateway
    objSelection.TypeParagraph()

    objSelection.Font.Bold = True
    objSelection.TypeText "Default TOS: "
    objSelection.Font.Bold = False
    objSelection.TypeText ""  & objItem.DefaultTOS
    objSelection.TypeParagraph()

    objSelection.Font.Bold = True
    objSelection.TypeText "Default TTL: "
    objSelection.Font.Bold = False
    objSelection.TypeText ""  & objItem.DefaultTTL
    objSelection.TypeParagraph()

    objSelection.Font.Bold = True
    objSelection.TypeText "Description: "
    objSelection.Font.Bold = True
    objSelection.Font.Bold = False
    objSelection.TypeText ""  & objItem.Description
    objSelection.TypeParagraph()

    objSelection.TypeParagraph()

Next

objDoc.SaveAs("C:/Scripts/Word/testdoc.doc")
objWord.Quit




JavaScript技術用jscript實現新建和保存一個word文檔,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 欧美综合在线观看 | 欧美第一页草草影院浮力 | 久久精品伊人 | 我被黑人巨大开嫩苞在线观看 | 国产91网站在线观看免费 | 日本青草| 精品999久久久久久中文字幕 | 伊人干综合网 | 丁香婷婷在线视频 | 老太婆性杂交欧美肥老太 | 久久ww | 精品麻豆国语国拍视频在线 | 天天摸天天看天天爽 | 国产大片好看免费播放 | 视色4se影院在线观看 | 二区三区在线观看 | 亚洲大成色www永久网址 | 国产精品视频一区二区三区 | 久久国产乱子伦精品免费看 | 天天色天天射天天操 | 国产福利91精品一区二区 | 激情婷婷 | 91网址免费入口 | 国内精品小视频 | 美女网站视频色 | 亚洲午夜免费 | 综合天堂| 涩涩涩涩涩涩涩涩涩涩 | 色老板在线永久免费视频凹凸 | 久久99久久精品国产只有 | 精品国语对白精品自拍视 | 成人国产精品视频 | 韩日美女| 五月丁香六月婷综合缴情在线 | 91福利网站 | 色哟哟在线观看精品大全视频 | 黄色网页在线播放 | 美女视频黄网站 | 日日插夜夜操 | 黄色的视频免费 | 亚州一区二区 |