Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Barcodes in Word Document 1

Status
Not open for further replies.

aljubicic

Programmer
Nov 7, 2002
82
AU
Hi All,

I need some help printing Barcodes in word.


I have a VB.Net application that does a few things but what I need it also to do is for a user to be able to enter text information into 5 text fields of the app and for it to launch Microsoft word using Code 3 of 9 font to display the 5 text strings on a single page of the word document as barcodes. Therefor it needs to display the barcodes on separate lines of the word doc and centered in th middle of the page. Also with a size of 20. Can anyone help me on how I can achieve this, or any that can point me in the right direction to help on this that would be fantastic.

Examples would be great.

Thanks Anthony
 
download the 3 of 9 font and use that. 3 of 9 is free and easy to find via google try looking for free barcode 39.

the other types of barcode font are more difficult to find. or you will have to pay for them.




Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
Yes I have downloaded the font 3 of 9, but how do I launch a word document already populated with barcoded text?
 
first you need to reference the microsoft word 10 COM component and then do something like this in code

Code:
Dim app As Word.Application
        Dim doc As Word.Document

        'get an instance of the MS Word application
        app = CreateObject("Word.Application")

        'create a new document
        doc = app.Documents.Add

        'initialize the document and write the content
        With doc.Content
            .Font.Name = "Arial"
            .Font.Size = 20
            .Text = "IKKE"
        End With

        'save the document and close Word
        doc.SaveAs("c:\mydoc.doc")
        doc.Close()
        app.Quit()
        doc = Nothing
        app = Nothing

chnge the font.name and .text to what you want.

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
I knew how to launch the default browser via hyperlinks, but not how to launch other programs. I must toy with this a bit. Thank you, Christiaan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top