Insert a barcode in MS Word doc using Macro

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Members online

Top