最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

用jscript實(shí)現(xiàn)新建和保存一個(gè)word文檔

 更新時(shí)間:2007年06月15日 00:00:00   作者:  
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. 
復(fù)制代碼 代碼如下:

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




相關(guān)文章

最新評(píng)論

东兰县| 呼伦贝尔市| 贵州省| 德化县| 遂川县| 五台县| 新建县| 蒙城县| 盘山县| 兴山县| 沂南县| 泰安市| 大方县| 玛纳斯县| 蓝山县| 罗城| 陈巴尔虎旗| 鄂州市| 松溪县| 平遥县| 兰考县| 观塘区| 富宁县| 光泽县| 青川县| 莒南县| 临沧市| 独山县| 武邑县| 乐业县| 东乌珠穆沁旗| 海口市| 渭源县| 旅游| 吴堡县| 阿瓦提县| 宜兰市| 云霄县| 郁南县| 博野县| 鸡泽县|