Imprimir con Printer alineando a la derecha
Visual Basic
Publicado el 7 de Febrero del 2002 por Administrador (718 códigos)
23.813 visualizaciones desde el 7 de Febrero del 2002
Este código imprime valores númericos y texto alineados a la derecha
Private Sub Form_Click()
Printer.Font = "Arial"
Printer.FontSize = 14
Printer.CurrentY = 100
Printer.CurrentX = 2000 - TextWidth(Format(1000, "#,##0"))
Printer.Print Format(1000, "#,##0")
Printer.CurrentY = 400
Printer.CurrentX = 2000 - TextWidth("16% IVA " & Format((1000 * 0.16), "#,##0"))
Printer.Print "16% IVA " & Format((1000 * 0.16), "#,##0")
Printer.CurrentY = 700
Printer.CurrentX = 2000 - TextWidth("Total : " & Format((1000 * 1.16), "#,##0"))
Printer.Print "Total : " & Format((1000 * 1.16), "#,##0")
Printer.EndDoc
End Sub
Ejecuta el formulario y pulsa sobre el mismo con el ratón.