
'выделяем все содержимое грида
MSFlexGrid1.Col = 1
MSFlexGrid1.Row = 1
MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
MSFlexGrid1.RowSel = MSFlexGrid1.Rows - 1
'забираем его и выводим в файл
Open "c:\text.txt" For Output As #1
Write #1, MSFlexGrid1.Clip
Close #1
Dim BeginPage, EndPage, NumCopies, Orientation, i
' Set Cancel to True.
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' Display the Print dialog box.
CommonDialog1.ShowPrinter
On Error GoTo ErrHandler
' Get user-selected values from the dialog box.
BeginPage = CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies = CommonDialog1.Copies
Orientation = CommonDialog1.Orientation
For i = 1 To NumCopies
' Put code here to send data to your printer.
Printer.PaintPicture MSFlexGrid1.Picture, Printer.Width / 25, Printer.Height / 25
Printer.EndDoc
Next
Exit Sub
ErrHandler:
' User pressed Cancel button.
Exit Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 11