1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Insert a barcode in MS Word doc using Macro

Discussion in 'Software Development' started by wango, Nov 13, 2001.

Thread Status:
Not open for further replies.
  1. wango

    wango Thread Starter

    Joined:
    Nov 13, 2001
    Messages:
    74
    How can I insert a barcode in an MS Word 97/2000 document using a "Macro".

    I have a macro like the one I have started on writing below. I am trying to write a bar code into a word doc by using a font and size change. Nothing seems to be working. I can have barcoding font called "True Font" installed on my machine.

    Any help out there!!!

    Thanks,

    Sub BarCode_Writer()
    '
    ' BarCode_Writer Macro
    ' Macro created 11/13/2001 by mitikavumam
    '
    ActiveDocument.Select

    ' possibility 1
    'Select and copy the text to the clipboard
    ActiveDocument.Bookmarks("\page").Select

    'Set the font size
    'Selection.Font.Size = txtSize.Text

    'Set the font weight etc.
    'Selection.Font.Bold = IIf(chkBold.Value = 1, True, False)
    'Selection.Font.Italic = IIf(chkItalic.Value = 1, True, False)
    'Selection.Font.Underline = IIf(chkUnderline.Value = 1, True, False)

    'Set the alignment
    'Selection.ParagraphFormat.Alignment = drpJustification.ListIndex ' (combo)

    'Type the text
    'Selection.TypeText txtTypeText.Text


    Selection.InsertAfter vbCr & "PPP" & i & vbCr


    'Select and copy the text to the clipboard
    'ActiveDocument.Bookmarks("\page").Range.Copy
    'App.ActiveDocument.Bookmarks("\StartOfDoc").Range.Copy

    ' possibility 2
    ' Position at top of original document
    ActiveDocument.Content.Select
    Selection.HomeKey Unit:=wdStory


    ' Append page marker to end of cover page
    'TextDocWindow.Activate
    'ActiveDocument.Content.Select
    'Selection.EndKey Unit:=wdStory
    'Selection.InsertAfter vbCr & "PPP" & i & vbCr

    'Set the font size
    ' Selection.Font.Size = txtSize.Text - error

    '- error by all three so rem out for now
    'Set the font weight etc.
    'Selection.Font.Bold = IIf(chkBold.Value = 1, True, False)
    'Selection.Font.Italic = IIf(chkItalic.Value = 1, True, False)
    'Selection.Font.Underline = IIf(chkUnderline.Value = 1, True, False)

    End Sub
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Insert barcode Word
  1. pcloudy
    Replies:
    1
    Views:
    237
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/58506

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice