參考來源
---
'取得選擇區域的座標...
X1 = MSFlexGrid1.ColSel
X2 = MSFlexGrid1.Col
Y1 = MSFlexGrid1.RowSel
Y2 = MSFlexGrid1.Row
MSFlexGrid1.Col = X1
MSFlexGrid1.Row = Y1
X1 = MSFlexGrid1.CellLeft: Y1 = MSFlexGrid1.CellTop
MSFlexGrid1.Col = X2
MSFlexGrid1.Row = Y2
X2 = MSFlexGrid1.CellLeft + MSFlexGrid1.CellWidth: Y2 = MSFlexGrid1.CellTop + MSFlexGrid1.CellHeight
.....'(必要時x1,x2 y1,y2 需對調!)
'將選擇區域貼到印表機...
printer.PaintPicture MSFlexGrid1.Picture, 0, 0, X2 - X1, Y2 - Y1, X1, Y1, X2 - X1, Y2 - Y1, vbSrcCopy
沒有留言:
張貼留言