⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.vbs

📁 漂亮的模板,商店销售统计,日销售,月销售统计,销售录入
💻 VBS
字号:
<script language="vbscript">


Sub buildDoc


set table = document.all.Revenue   


row = table.rows.length   


column = table.rows(1).cells.length   


Set objWordDoc = CreateObject("Word.Document") 


Dim theArray(10,10000)   





for i=0 to row-1


for j=0 to column-1


theArray(j+1,i+1) = table.rows(i).cells(j).innerTEXT  


next


next


 


objWordDoc.Application.ActiveDocument.Paragraphs.Add.Range.InsertBefore("公司员工统计表")   


objWordDoc.Application.ActiveDocument.Paragraphs.Add.Range.InsertBefore("")


 


Set rngPara = objWordDoc.Application.ActiveDocument.Paragraphs(1).Range





With rngPara


.Bold = True  


.ParagraphFormat.Alignment = 1   


.Font.Name = "Arial"   


.Font.Size = 12   


End With


 


Set rngCurrent = objWordDoc.Application.ActiveDocument.Paragraphs(3).Range


Set tabCurrent = ObjWordDoc.Application.ActiveDocument.Tables.Add(rngCurrent,row,column)




for i = 1 to column


objWordDoc.Application.ActiveDocument.Tables(1).Rows(1).Cells(i).Range.InsertAfter theArray(i,1)


objWordDoc.Application.ActiveDocument.Tables(1).Rows(1).Cells(i).Range.ParagraphFormat.alignment=1


next





For i =1 to column


For j = 2 to row


objWordDoc.Application.ActiveDocument.Tables(1).Rows(j).Cells(i).Range.InsertAfter theArray(i,j)


objWordDoc.Application.ActiveDocument.Tables(1).Rows(j).Cells(i).Range.ParagraphFormat.alignment=1


Next


Next


objWordDoc.Application.ActiveDocument.SaveAs


End Sub


</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -