婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > asp調用Word打印的代碼

asp調用Word打印的代碼

熱門標簽:離線電子地圖標注軟件注冊 為什么外呼系統需要預存話費呢 蘭州智能語音電銷機器人功能 寧夏怎么申請400電話 常用地圖標注范圍點 辦理400電話一年多少錢 企數外呼系統能用多久 外呼回撥系統圖片 咸陽銷售外呼系統
調用Word打印... 
運行下列的腳本需要將IE的安全級別設為低,或在中級安全級別下將那個ActiveX控件設為啟用,別忘記了: 
html> 
head> 
title>Build Document by Script/TITLE> 
/HEAD> 
Table id="myData" border=1 align=center> 
Tr align=center> 
Td>產品名稱/Td> 
Td>產品描述/Td> 
Td>產品單價/Td> 
Td>產品等級/Td> 
/Tr> 
Tr align=center> 
Td>產品一/Td> 
Td>This is a test/Td> 
Td align=right>300.50/Td> 
Td>一級/Td> 
/Tr> 
Tr align=center> 
Td>產品二/Td> 
Td>This is a test/Td> 
Td align=right>300.50/Td> 
Td>一級/Td> 
/Tr> 
Tr align=center> 
Td>產品三/Td> 
Td>This is a test/Td> 
Td align=right>300.50/Td> 
Td>一級/Td> 
/Tr> 
/Tabld> 
input type=button onclick="vbscript:buildDoc '',4" value="build"> 
BODY> 
/BODY> 
/HTML> 
script language="vbscript"> 
Sub buildDoc(theTemplate,intTableRows) 
Dim Table1 
set Table1 = document.all.myData 
row = Table1.rows.length 
Set objWordDoc = CreateObject("Word.Document") 
ObjWordDoc.Application.Visible=True 
Dim theArray(4,4) 
'Redim Preserve theArray(4,row) 
colnum = Table1.rows(1).cells.length 
for i=0 to row-1 
for j=0 to colnum-1 
theArray(j+1,i+1) = Table1.rows(i).cells(j).innerHTML 
next 
next 
intNumrows = 4 
objWordDoc.Application.ActiveDocument.Paragraphs.Add.Range.InsertBefore("測試的表格") 
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,intNumrows,4) 
for i = 1 to colnum 
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 
tabRow = 2 
For j = 2 to intNumrows 
'ObjWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Borders.Enable=False 
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(1).Range.InsertAfter theArray(1,j) 
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(1).Range.ParagraphFormat.alignment=1 
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(2).Range.InsertAfter theArray(2,j) 
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(2).Range.ParagraphFormat.alignment=1 
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(3).Range.InsertAfter FormatCurrency(theArray(3,j)) 
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(3).Range.ParagraphFormat.alignment=2 
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(4).Range.InsertAfter theArray(4,j) 
'objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(4).Range.InsertAfter Chr(10) 
objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(4).Range.ParagraphFormat.alignment=1 
tabRow = tabRow + 1 
Next 
' objWordDoc.Application.ActiveDocument.Tables(1).Rows(tabRow).Cells(4).Range.ParagraphFormat.alignment=1 
'objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter(" ") 
'objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter(" ") 
'objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter("Regards,") 
'objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter(" ") 
'objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter("Daryl B. Morticum") 
'objWordDoc.Application.ActiveDocument.Paragraph.Add.Range.InsertAfter("Sales Associate") 
'objWordDoc.Application.ActiveDocument.Envelope.Insert Address 
' objWordDoc.Application.ActiveDocument.Paragraphs.Add.Range.InsertAfter("由廖家遠設計") 
objWordDoc.Application.ActiveDocument.SaveAs "tempSample.doc", 0,False,"",True,"",False,False,False, False,False 
'objWordDoc.Application.printout() 
End Sub 
/script>

標簽:鐵嶺 泰州 家電維修 麗江 昌都 昆明 溫州 咸陽

巨人網絡通訊聲明:本文標題《asp調用Word打印的代碼》,本文關鍵詞  asp,調用,Word,打印,的,代碼,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《asp調用Word打印的代碼》相關的同類信息!
  • 本頁收集關于asp調用Word打印的代碼的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 乳山市| 板桥市| 顺昌县| 即墨市| 黔南| 济阳县| 徐水县| 瓦房店市| 宾阳县| 深泽县| 老河口市| 磴口县| 北安市| 泰兴市| 土默特左旗| 鄯善县| 东乡县| 涞源县| 天长市| 察哈| 商南县| 永安市| 青岛市| 顺昌县| 华宁县| 西和县| 新绛县| 昌黎县| 裕民县| 拜城县| 金湖县| 洪湖市| 牙克石市| 祁门县| 长寿区| 吉安县| 师宗县| 内丘县| 高青县| 唐河县| 祁东县|