Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8692879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:24:49+00:00 2026-06-13T00:24:49+00:00

i need to print formatted text like in the image below, how can i

  • 0

i need to print formatted text like in the image below, how can i achive this in vb6, given that vb6 print object is not friendly for such this

The data i need to print that represented by the boxes are non related

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:24:50+00:00Added an answer on June 13, 2026 at 12:24 am

    It is not very difficult. You use the ScaleLeft, ScaleWidth, CurrentX, and CurrentY properties to set where printing begins on the page. In this case you will probably also want to set the Orientation property to vbPROPortrait. Using those positioning properties, and setting the font and style you want you then call Printer.Print

    This method will draw 4 boxes onto a page. Play with the (x, y) coordinates or hard code the numbers to alter the sizes. Remove the .EndDoc statement if you don’t want the printer to print the page from this method and call Printer.EndDoc from somewhere else. Full Printer object documentation for VB6 can be found at http://msdn.microsoft.com/en-us/library/aa443915%28v=vs.60%29.aspx

    Private Sub DrawBox()
    
        With Printer
            .ScaleMode = vbTwips
            lngScaleWidth = .ScaleWidth
            lngScaleHeight = .ScaleHeight
            Printer.Line (.ScaleLeft + lngMargin, .ScaleTop + lngMargin)-(lngScaleWidth / 2 - (100 + lngMargin * 2), lngScaleHeight / 2 - (100 + lngMargin * 2)), lngColor, B
            Printer.Line (lngScaleWidth / 2 + (100 + lngMargin * 2), .ScaleTop + lngMargin)-(.ScaleWidth - lngMargin, lngScaleHeight / 2 - (100 + lngMargin * 2)), lngColor, B
            Printer.Line (.ScaleLeft + lngMargin, lngScaleHeight / 2 + (100 + lngMargin * 2))-(lngScaleWidth / 2 - (100 + lngMargin * 2), .ScaleHeight - lngMargin), lngColor, B
            Printer.Line (lngScaleWidth / 2 + (100 + lngMargin * 2), lngScaleHeight / 2 + (100 + lngMargin * 2))-(.ScaleWidth - lngMargin, .ScaleHeight - lngMargin), lngColor, B
            .EndDoc
        End With
    
    End Sub
    

    The sample code below demonstrates some of the positioning and other properties.

    Dim lMargin as Integer
    lMargin = 200
    
    With Printer
        .FontBold = True
        .FontItalic = False
        .CurrentY = .CurrentY + (3 * .TextHeight(App.ProductName))
        .CurrentX = lLeftMargin
        .FontName = "Arial"
        .FontSize = 11
        Printer.Print "Date " & strTransDate
    End With
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to print out receipts that inserted into my database, and the latest
I need to print report page that has couple of background images on it.
I need to print the ASCII value of the given character in awk only.
Ok so I have a text file that will change regularly that I need
I have created an algorithm that converts text formatted in SVG into HTML, the
I need to export some numeric values from a given ASCII text file and
I have a text file formatted so that there are 3 numbers, separated by
I'm trying to achieve a layout in html that looks exactly like this when
I need to print some data (a little bit strange formatted). I was writing
I have a string formatted as below Walk Off the Earth - Somebody That

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.