手机
当前位置:查字典教程网 >编程开发 >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】相关文章:

网页常用特效代码整理

jQuery实现将页面上HTML标签换成另外标签的方法

滚动效果

js-穷举法 (y0h)

Jquery zTree 树控件异步加载操作

JavaScript中继承用法实例分析

Java的不同版本:J2SE、J2EE、J2ME的区别

測試代碼真方便

无刷新上传文件并返回自定义值

jquery插件splitScren实现页面分屏切换模板特效

精品推荐
分类导航