Private Sub Detail_Format(Cancel As Integer, _ FormatCount As Integer) Dim rpt as Report Dim strMessage As String Dim intHorSize As Integer, intVerSize As Integer Set rpt = Me strMessage = "DisplayMessage" With rpt 'Set scale to pixels, and set FontName and 'FontSize properties. .ScaleMode = 3 .FontName = "Courier" .FontSize = 24 End With ' Horizontal width. intHorSize = Rpt.TextWidth(strMessage) ' Vertical height. intVerSize = Rpt.TextHeight(strMessage) ' Calculate location of text to be displayed. Rpt.CurrentX = (Rpt.ScaleWidth/2) - (intHorSize/2) Rpt.CurrentY = (Rpt.ScaleHeight/2) - (intVerSize/2) ' Print text on Report object. Rpt.Print strMessage End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question