|
-
Sep 22nd, 2005, 08:23 PM
#1
Thread Starter
Lively Member
MS Word and Barcode font
Hi, all
i have a font problem with a word doc :
VB Code:
Dim WordObj As Word.Application
Dim WordDoc As Word.Document
Dim WordRange As Word.Range
Dim WordTable As Word.Table
Dim WordColumn As Word.Column
Dim WordRow As Word.Row
Private Sub Command1_Click()
Set WordObj = Nothing
Set WordObj = CreateObject("Word.Application")
Set WordDoc = WordObj.Documents.Add(DocumentType:=wdNewBlankDocument) 'Open the document
Set WordRange = WordDoc.Range(Start:=0, End:=0)
WordObj.Visible = True
With WordRange
'.Font.Name = "Code 128"
'.Font.Size = 16
.InsertParagraphAfter
.InsertParagraphAfter
.SetRange Start:=WordRange.End, _
End:=WordRange.End
End With
WordDoc.Range(Start:=0, End:=0).Bold = True
Set WordTable = WordDoc.Tables.Add(WordDoc.Paragraphs.Item(2).Range, 1, 2, wdWord9TableBehavior, wdAutoFitFixed)
Set WordRow = WordTable.Rows.Add(BeforeRow:=WordTable.Rows(1))
Selection.GoTo What:=wdGoToTable, Which:=wdGoToNext
WordDoc.Tables(1).Cell(1, 1).Select
WordRange = Selection.Range
' Adds info to cells
With WordObj
' Prints BC1
'.ActiveWindow.Selection.Font.Size = 20
WordRange.Font.Name = "Code 128"
WordRange.Text = "34324324324332"
WordRange.Move Unit:=wdCell
WordRange.Font.Name = "Code 128"
WordRange.Text = "34324324324332"
WordRange.Move Unit:=wdCell
'WordTable.Rows.Add BeforeRow:=WordTable.Rows(1)
End With
WordObj.ActiveDocument.SaveAs "C:\BarCode.doc"
End Sub
when run it creates the word doc, saves it all fine but it doesnt print out in "Code 128" Font, Ive installed it in the font folder, and if i open word app manually and use it it prints fine, but when i run the code it just prints out in "New Roman" or something
ive looked around msdn and google but nothing really
would anyone know why the font wont shift to code 128?
Thanks
I'm not a pain in the ass, Im just making things intresting......
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|