手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >Add a Formatted Table to a Word Document
Add a Formatted Table to a Word Document
摘要:Demonstrationscriptthatretrievesservicedatafromacomputerandthendisplay...

Demonstrationscriptthatretrievesservicedatafromacomputerand

thendisplaysthatdatainaformattedtableinMicrosoftWord.

复制代码 代码如下:

SetobjWord=CreateObject("Word.Application")

objWord.Visible=True

SetobjDoc=objWord.Documents.Add()

SetobjRange=objDoc.Range()

objDoc.Tables.AddobjRange,1,3

SetobjTable=objDoc.Tables(1)

x=1

strComputer="."

SetobjWMIService=_

GetObject("winmgmts:"&strComputer&"rootcimv2")

SetcolItems=objWMIService.ExecQuery("Select*fromWin32_Service")

ForEachobjItemincolItems

Ifx>1Then

objTable.Rows.Add()

EndIf

objTable.Cell(x,1).Range.Font.Bold=True

objTable.Cell(x,1).Range.Text=objItem.Name

objTable.Cell(x,2).Range.text=objItem.DisplayName

objTable.Cell(x,3).Range.text=objItem.State

x=x+1

Next

【Add a Formatted Table to a Word Document】相关文章:

网页常用特效代码整理

javascript实现youku的视频代码自适应宽度

nodejs实现遍历文件夹并统计文件大小

jquery滚动特效集锦

javascript实现行拖动的方法

JavaScript正则表达式中的global属性的使用

js实现两点之间画线的方法

js-穷举法 (y0h)

滚动效果

Jquery动态添加输入框的方法

精品推荐
分类导航