Printer.Width = 13488
    Printer.Height = 15872
        
    Printer.ScaleMode = vbCentimeters
        
    Printer.Font = "宋体"
    Printer.FontSize = "11"
    Printer.ScaleTop = 0
    Printer.ScaleLeft = -1
    
    Dim j As Integer
    j = 2
    For i = 0 To MSHFlexGrid1.Rows - 1
       
       Printer.CurrentX = 3
       Printer.CurrentY = 0.1
       Printer.Print "储蓄操作详细清单" & Space(2) & "营业员:" & yyy.gh & Space(3) & "日期:" & nowdate & "   总金额:" & khzje + xczje & "  新开户:" & khzje & "  续存:" & xczje
       
       
       MSHFlexGrid1.Row = i
       
       MSHFlexGrid1.Col = 0
       
       
             
       Printer.CurrentX = 0.5
       Printer.CurrentY = j * 0.4
       Printer.Print MSHFlexGrid1.Text
       
       MSHFlexGrid1.Col = MSHFlexGrid1.Col + 1
       Printer.CurrentX = 3
       Printer.CurrentY = j * 0.4
       Printer.Print MSHFlexGrid1.Text
       
       MSHFlexGrid1.Col = MSHFlexGrid1.Col + 1
       Printer.CurrentX = 5.5
       Printer.CurrentY = j * 0.4
       Printer.Print MSHFlexGrid1.Text
       
       MSHFlexGrid1.Col = MSHFlexGrid1.Col + 1
       Printer.CurrentX = 8
       Printer.CurrentY = j * 0.4
       Printer.Print MSHFlexGrid1.Text
       
       MSHFlexGrid1.Col = MSHFlexGrid1.Col + 1
       Printer.CurrentX = 10.5
       Printer.CurrentY = j * 0.4
       Printer.Print MSHFlexGrid1.Text
       
       MSHFlexGrid1.Col = MSHFlexGrid1.Col + 1
       Printer.CurrentX = 13
       Printer.CurrentY = j * 0.4
       Printer.Print MSHFlexGrid1.Text
       
       j = j + 1
       If Printer.CurrentY > 26 Then
         j = 2
         Printer.NewPage
       End If
       
       
       
       
    Next
    
    Printer.EndDoc

解决方案 »

  1.   

    用 DataReport 打印 DataGrid 
    http://www.triaton.com.cn/Private/Zip/DatGrdRpt.zip DataReport 程序 
    http://www.triaton.com.cn/Private/Zip/DatRpt.zip用 DataReport 打印 BarCode 
    http://www.triaton.com.cn/Private/Zip/BarCodeRpt.zip 
      

  2.   

    先装入Excel 9.0 Object Library 写入代码:
    dim xlApp as Excel.application
    dim xlBook as excel.workbook
    dim xlSheet as excel.worksheeet
    set xlapp=createObject("excel.application")
    set xlbook=xlapp.workbooks.open("excel模板文件名") '打开模板文件
    set xlsheet=xlbook.worksheets(1) '打开当前工作簿的第一页
    .........
      

  3.   

    先装入Excel 9.0 Object Library 写入代码:请问这个东西在哪加入啊?我看部件与Ole中没有,只有excel表与这个工作薄好像。
      

  4.   

    我正在写一个
      马上完成
    指标如下:
        可以直接绑定  MSHFLEXGRID 控件
        页眉页角
        页号
        名称
        正文
        备注
        可以动态设置位置(名称,正文,备注,MSH)
        可以使用多模板
    还有4天时间完成
    需要留下EMAIL
    ;、'如果你们有特殊功能请提出来
      

  5.   

    OrchidPrinter
    www.orient-orchid.com
      

  6.   

    关注:不过先想搞清楚,什么是MSHFLEXGRID 
    和这个datagrid是同一个玩意么?我的信箱[email protected]....^_^^_^
      

  7.   

    导入excel的代码:(就一句话)
    cn.execute "select * into sheetname in '' [database=" & app.path & "\test.xls;Excel 5.0] from test where 你的条件"
      

  8.   

    那么怎么再删除这个sheetname的表呢?怎么弄?
      

  9.   

    up 
    [email protected]
      

  10.   

    在VB中如何删除一个EXCEL表中的工作薄呢?