Sub btnexport_onclick () 'Alert (Document.ll.Mytable.Rows (0) .Cells.Length) DIM Object CreateFolder () deletefile ("c: / revert /" & document.all.info.info.info.info.info.info.info.info.i.Value & ". xls ") Set objexcel = createObject (" excel.application ") with objects (" sheet1 "). SELECT end with m_row =" 0 "with objects (1) .range (.Cells (1, 1), .cells (1, Document.all.mytable.cells.Length)). Font.name = "Song" 'set the title as a black body. Range (.cells (1, 1), .Cells (1, Document.all.Mytable.cells.Length)). Font.Bold = True 'Title Fonts Bold. Range (.cells (1, 1), .cells (Document.all.Mytable.Rows.LENGTH Document.all.mytable.Rows (0) .Cells.Length)). Borders.LineStyle = 1 'Sets the table Border pattern. Range (.Cells (1, 1), .cells (Document.all.Mytable.Rows. Length, document.all.mytable.Rows (0) .c Ells.length)). font.name = "Song" .range (.cells (1, 1), .cells (Document.all.Mytable.Rows.Length, Document.all.Mytable.Rows (0) .Cells. Length)). font.size = "9" .range (.cells (1, 1), .cells (Document.all.Mytable.Rows.Length, Document.all.Mytable.Rows (0) .Cells.Length) ) .RAPText = true .range (.Cells (1, 1), .cells (Document.all.Mytable.Rows.Length, Document.all.Mytable.Rows (0) .Cells.Length)). Horizontalalignment = XLCenter. Range (.Cells (1, 1), .cells (Document.all.Mytable.Rows.Length, Document.all.Mytable.Rows (0) .Cells.Length). Shrinktofit = true
End with
With objexcel.activeworkbookbook.sheets (1) .pagesetup .leftheader = "" & chr (10) & "" Song, General "& 10 business module:" & document.all.info.Value .Centerheader = "&" "Song Body, Bold" "Chaohu Distribution Geographic Information System" .rightheader = "& Chr (10) &" & "" Song Body, General "& 10 Print Date:" & now () .leftfooter = "&" "Song General "" & 10 Players: "" "" "" "" "" "" "" "" "" "" "" " With 'Objexcel.cells (2, 2) .value = Document.all.info.Value
'Objexcel.cells (3, 2) .value = "Print Time:" & now () for a = 0 to Document.all.Mytable.Rows.Length-1 M_ROW = CSTR (int (m_row) 1) for b = 0 to Document.all.mytable.Rows (a) .Cells.Length-1 m_Col = CHR (ASC ("a") b) 'Alert (Document.all.Mytable.Rows (0) .Cells (m_col). Width) 'objexcel.Columns (m_col) .ColumnWidth = document.all.mytable.rows (0) .Cells (m_col) .Width objexcel.range (m_col & m_row) .select m_value = (document.all.mytable.rows (a) .cells (b) .innerText) objexcel.activecell.value = cstr (m_value) next next objexcel.visible = true objexcel.range ( "A1") select objExcel.ActiveWorkBook.SaveAs. "C: / Report /" & document.all .info.value & ". xls" 'deletefile ("c: / report /" & document.all.info.value & ". xls") End Subsub setStyle (Obj) with obj.activeworkbook.sheets (1) .range (.Cells) (1, 1), .cells (1, 4)). Font.name = "Song" .range (.cells (1, 1), .cells (1, 4)). Font.Bold = True .range. .Cells ( 1, 1), .cells (1, 4)). Mergecells = true .range (.cells (3, 2), .cells (3, 4)). Mergecells = true .range (.Cells (4, 2) .Cells (4, 4)). Mergecells = true .range (.cells (5, 2), .cells (5, 4)). Mergecells = true .range (.cells (8, 2), .Cells ( 8, 4)). Mergecells = true .range (.cells (2, 1), .cells (9, 4)). Borders.LinesTyle = 1 if Document.getElementByid ("ReportStyle"). Value <> "" .Range (.Cells (11, 2), .cells (11, 4)). Mergecells = true .range (.cells (12, 2), .cells (12, 4)). Mergecells =