S
siddharthkhare
Hi,
I am trying to generate lables from c# .
Could some one please suggest what is the best appraoch for generating
lables amongs following three.
and what is the pros and cons of all of these three. Code has already
been wrtten by some one else using appraoch 1. I trying to find out if
i need to change to do label printing differently
1 . Generate a HTml word document . So just print the document using
word automation. To make sure that it it fits the lables properly tweak
the width of <td> and <tr> in the doc.
2. Use word object model as given below.
Set oDoc = Application.MailingLabel.CreateNewDocument(Name:=LabelType)
' if AddressArray has been passed, insert the addresses into the labels
i = LBound(LabelTextArray)
Do
Selection.TypeText LabelTextArray(i)
i = i + 1
If i = UBound(LabelTextArray) + 1 Then Exit Do
' move/generate a new cell/cells (according to label type--see the
' LabelMoveCount function for details)
Selection.MoveRight Unit:=wdCell,
Count:=LabelMoveCount(LabelType, i)
Loop
Else
' raise an error
End If
3. Create a avery 5160 doc in word. save it as html and some how embeed
query in that to get actual data.
4.use mailmerge ...I do not know much about it.
I am trying to understand if it has been done using appraoch 1. is
there any specific reason to change it to any other appraoch. In my
case lables will always be printed in one size only.
Thanks
Siddharth
I am trying to generate lables from c# .
Could some one please suggest what is the best appraoch for generating
lables amongs following three.
and what is the pros and cons of all of these three. Code has already
been wrtten by some one else using appraoch 1. I trying to find out if
i need to change to do label printing differently
1 . Generate a HTml word document . So just print the document using
word automation. To make sure that it it fits the lables properly tweak
the width of <td> and <tr> in the doc.
2. Use word object model as given below.
Set oDoc = Application.MailingLabel.CreateNewDocument(Name:=LabelType)
' if AddressArray has been passed, insert the addresses into the labels
i = LBound(LabelTextArray)
Do
Selection.TypeText LabelTextArray(i)
i = i + 1
If i = UBound(LabelTextArray) + 1 Then Exit Do
' move/generate a new cell/cells (according to label type--see the
' LabelMoveCount function for details)
Selection.MoveRight Unit:=wdCell,
Count:=LabelMoveCount(LabelType, i)
Loop
Else
' raise an error
End If
3. Create a avery 5160 doc in word. save it as html and some how embeed
query in that to get actual data.
4.use mailmerge ...I do not know much about it.
I am trying to understand if it has been done using appraoch 1. is
there any specific reason to change it to any other appraoch. In my
case lables will always be printed in one size only.
Thanks
Siddharth