VB Code:
Private Sub Command1_Click() '============================ Dim pct As PictureBox MSChart1.EditCopy Set pct = Controls.Add("VB.Picturebox", "pctTemp") pct.AutoSize = True pct.AutoRedraw = True pct.Picture = Clipboard.GetData(vbCFMetafile) Printer.FontBold = True Printer.FontSize = 12 Printer.FontUnderline = True Printer.CurrentX = (Printer.Width - Printer.TextWidth("CPMS Representative Trend Report")) / 2 Printer.CurrentY = 400 Printer.Print "Daily Report" Printer.CurrentX = Printer.CurrentX + 400 Printer.PaintPicture pct.Picture, _ (Printer.Width - MSChart1.Width) / 2, _ Printer.CurrentY, _ MSChart1.Width, _ MSChart1.Height Printer.EndDoc Controls.Remove "pctTemp" Set pct = Nothing End Sub
I found this sub from a search on this forum,I tried it but the page is printed at the top of the page,I want the page to be printed at the center of the page(centered horizontally and centered vertically).
How can I do it?
thanks


Reply With Quote