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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to Automate Labels in Word 97 via vb6

Status
Not open for further replies.

mpoe3

Programmer
Jun 12, 2003
1
US
I'm trying to automate a barcode lable process... I want to use word automation object in a visual basic application to expose the labels and envelopes dialog in word 97, and sent it some text. My problem is even after I envoke the proper dialog, when I send text using the typetext method, the string goes to the default active document, not the dialog.
heres the pseudo-code...
Dim objWD As Word.Application
Set objWD = CreateObject("Word.Application")
objWD.Documents.Add
objWD.Selection.Font.Name = "IDAutomation.com Code39"
objWD.Selection.Font.SetAsTemplateDefault
objWD.Selection.TypeText "*34525765*"
objWD.Selection.WholeStory
objWD.Selection.Copy
objWD.Application.Dialogs(wdDialogToolsCreateLabels).Display
objWD.Quit (False)
Set objWD = Nothing
IDEAS ???
Thanks in advance
 
Not too familiar with the labels dialogue in Word, but I bet you could set this up VERY easily in Excel. Just set the column widths, row heights, and page margins of a spreadsheet to print correctly to your labels, format the cells to use your barcode font, then write your barcode values to the cells.

VBAjedi [swords]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top