Printing Custom sized stickers

E

Eager_Beever

I need to print custom-sized stickers from my VB 6 application. The data is
available from an Access database. Initially I tried to use Table to
poplulate the cells with data (I need 3 lines in each cell). Though I am able
to populate the cells properly, I am facing problems with Font size,
Alignment, Adjusting the borders and gaps etc. Also I am not able to assign
fixed sized to different columns. Any suggestions??

Thank You.

Eager_Beever

N.B. Sometime back I also needed some help with creating a properly
formatted Word document through VB 6. The reply by Cindy M. solved my
problem. Thank you again Cindy and wishing everybody a Happy New Year.
 
C

Cindy M.

Hi =?Utf-8?B?RWFnZXJfQmVldmVy?=,
I need to print custom-sized stickers from my VB 6 application. The data is
available from an Access database. Initially I tried to use Table to
poplulate the cells with data (I need 3 lines in each cell). Though I am able
to populate the cells properly, I am facing problems with Font size,
Alignment, Adjusting the borders and gaps etc. Also I am not able to assign
fixed sized to different columns. Any suggestions??
Hard to make suggestions without knowing the details of the problems. Can you
elaborate a bit more? It's also a good idea to mention the version of Word
involved in a problem...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
C

Cindy M.

Hi Beever,

OK, if I'm following this correctly, the main problem is that Word isn't giving
you static column widths for the table that defines the stickers?

You can specify static column widths when you create the table. Look at the Word
VBA Help for the Tables.Add method and pay special attention to the
information for the parameter DefaultTableBehavior:

DefaultTableBehavior Optional Variant. Sets a value that specifies whether
Microsoft Word automatically resizes cells in tables to fit the cells’ contents
(AutoFit). Can be either of the following constants: wdWord8TableBehavior
(AutoFit disabled) or wdWord9TableBehavior (AutoFit enabled). The default
constant is wdWord8TableBehavior.

After the fact, you can set the AllowAutoFit property to False.

Personally, I prefer to take care of this when creating the table, as it will
speed the process considerably. Dynamic calculation of column width and laying
the table out on the page for "every character" is extremely resource intensive.
My Access Table contains details Like Product Code, Description and Weight.
The user wants to print these details on small stickers to be pasted on the
products. Each info will be on separate lines, hence the font size has to be
small (around 4 or 5). I tried to do this using Word Table. I am able to
populate the cells correctly, each cell containing 3 separate lines. One
problem is that, the Word document being created in not able to draw the
Table properly and align the data correctly. Since I was not able to create
colums with a fixed width (I was planning to assign the even numbered columns
to represent the gaps and borders on two stickers on the same row), I placed
spaces on either sides of the strings on each line. But the values are not
being center aligned. After creating the document, I have to manually select
the Table and align it again. Even then, I am facing some problems like
correct alligning, improper gap adjustment, etc. Is there a better way to
print the details on stickers (Each sheet contains 11 columns across and 10
rows, i.e. 11 * 10 = 110 stickers)?? I might have to change the Sheet size,
No. of rows and columns on each sheet, sticker size and gaps between columns
and rows. (The user is likely to change the Font Size depending upon the
availability of sticker sizes). I though that since Word has a feature to
print Labels and Stickers, I could execute it using VBA. But I was not able
to get any help.

I am using VisualBasic 6 SP6 and Word XP/2003.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
E

Eager_Beever

Hi Cindy,

Thank you again for your reply. I am not at my system and hence yet to
implement your suggestions. I will do it this night or tomorrow morning. This
time, I liked your suggestion more, as instead of giving the codes you gave
me suggestions (or pointed me in the right direction). As a result, I will be
able to learn some more also which will help me further.

BTW, is there any other way to print onto stickers from VB 6 using Word
XP/2003?

Thank You.
 
C

Cindy M.

Hi =?Utf-8?B?RWFnZXJfQmVldmVy?=,
BTW, is there any other way to print onto stickers from VB 6 using Word
XP/2003?
I'm not sure what kind of thing you have in mind... Since you say these
are custom-sized stickers, you probably can't go over the "Labels"
collection.

Rather than creating the table every time on-the-fly you could create the
table (by hand) in Word, then save the result as a template. To generate a
set of stickers, use the Documents.Add method to create a new document
from the template. Or, you could possibly use Word's internal mail merge
feature.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top