A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

printing labels from a form using a macro



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2005, 05:23 PM
mary
external usenet poster
 
Posts: n/a
Default printing labels from a form using a macro

I'm creating a form that our clients can fill out in
Microsoft Word. I've been asked that our clients be able
to print labels from this form as well, grabbing
information from a particular field on the form. The
field's name is "FieldNo." The label "FieldNo" is not in
the first row of the form, it's half-way down the page.
I don't want the clients to go through a mailmerge
process, I'd like them to be able to choose a button that
says "Print Labels", and the labels will print. We're
going to use Avery 8160 for the labels. The client will
enter 1 or more field nos. in the field no. column. I'm
guessing I'll need to create a macro to do this, but I'm
a macro rookie. Can anyone help me with this? Thank
you!
  #2  
Old April 30th, 2005, 02:21 PM
Cindy M -WordMVP-
external usenet poster
 
Posts: n/a
Default

Hi Mary,

I'm creating a form that our clients can fill out in
Microsoft Word. I've been asked that our clients be able
to print labels from this form as well, grabbing
information from a particular field on the form. The
field's name is "FieldNo." The label "FieldNo" is not in
the first row of the form, it's half-way down the page.
I don't want the clients to go through a mailmerge
process, I'd like them to be able to choose a button that
says "Print Labels", and the labels will print. We're
going to use Avery 8160 for the labels. The client will
enter 1 or more field nos. in the field no. column. I'm
guessing I'll need to create a macro to do this, but I'm
a macro rookie.

A couple of questions

1. Version of Word?

2. Is this a form created using the Forms toolbar, or
something else?

3. If you're in a regular document (not protected as a
form), does the Tools/Envelopes and Labels/Labels command do
basically what you need?

Note: the correct place to get help on macros if you've no
experience is the word.vba.beginners newsgroup.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun
8 2004)
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
:-)

  #3  
Old May 2nd, 2005, 02:14 PM
Mary
external usenet poster
 
Posts: n/a
Default


-----Original Message-----
Hi Mary,

I'm creating a form that our clients can fill out in
Microsoft Word. I've been asked that our clients be

able
to print labels from this form as well, grabbing
information from a particular field on the form. The
field's name is "FieldNo." The label "FieldNo" is not

in
the first row of the form, it's half-way down the

page.
I don't want the clients to go through a mailmerge
process, I'd like them to be able to choose a button

that
says "Print Labels", and the labels will print. We're
going to use Avery 8160 for the labels. The client

will
enter 1 or more field nos. in the field no. column.

I'm
guessing I'll need to create a macro to do this, but

I'm
a macro rookie.

A couple of questions

1. Version of Word?

2. Is this a form created using the Forms toolbar, or
something else?

3. If you're in a regular document (not protected as a
form), does the Tools/Envelopes and Labels/Labels

command do
basically what you need?

Note: the correct place to get help on macros if you've

no
experience is the word.vba.beginners newsgroup.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update

Jun
8 2004)
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
:-)

.


Hi Cindy,

Thanks for the reply.

1. I'm using Microsoft Word 2002.
2. Yes, I created the form using the forms toolbar,
after downloading an example Template from Microsoft's
page.
3. The Envelopes/Labels command in a normal document
doesn't do exactly what I need. I have 5 text form
fields in a form (at some point there might be more) that
I need to generate 5 Avery 8160 labels for at the same
time. The fields are "Text1" - "Text5".
I've created a data source document that contains a table
with 1 column and 30 rows of data. The first row of data
(after the header row), is a field I've bookmarked. My
plan was to get the value of "Text1" from my form
document into the bookmark called "label1" in the first
field of the data source, and so on.
Then I'll use my data source to mail merge (hopefully
with a macro) with a main label document I've created
(Avery 8160). I don't know if this is the correct plan
of action or not, but so far I haven't done well. I have
problems with the bookmarks, saying the "range can't be
deleted". I think it's going to delete my bookmarks, and
when I try to type in code to avoid this, I have no
luck. I even have problems opening the data source from
a macro in the form (says I have the wrong path or file
name, even though I used the macro recorder to record the
macro). I haven't even gotten to the mail merge part
yet, because I can't get the data from the
bookmark "Text1" in the form to the bookmark "label1" in
the data source document, much less leave the bookmarks
in tact.
Thanks for reading my post.
p.s. What's the web address for the vba beginners site
you mentioned I should use? I tried typing in
www.word.vba.beginners newsgroup but that didn't work.
Thanks.


  #4  
Old May 2nd, 2005, 04:53 PM
Mary
external usenet poster
 
Posts: n/a
Default


-----Original Message-----
Hi Mary,

I'm creating a form that our clients can fill out in
Microsoft Word. I've been asked that our clients be

able
to print labels from this form as well, grabbing
information from a particular field on the form. The
field's name is "FieldNo." The label "FieldNo" is not

in
the first row of the form, it's half-way down the

page.
I don't want the clients to go through a mailmerge
process, I'd like them to be able to choose a button

that
says "Print Labels", and the labels will print. We're
going to use Avery 8160 for the labels. The client

will
enter 1 or more field nos. in the field no. column.

I'm
guessing I'll need to create a macro to do this, but

I'm
a macro rookie.

A couple of questions

1. Version of Word?

2. Is this a form created using the Forms toolbar, or
something else?

3. If you're in a regular document (not protected as a
form), does the Tools/Envelopes and Labels/Labels

command do
basically what you need?

Note: the correct place to get help on macros if you've

no
experience is the word.vba.beginners newsgroup.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update

Jun
8 2004)
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
:-)

.

Hi again Cindy,

I just wanted to tell you I've made some progress since
the last post. I have my datasource opening from a macro
in my form, and I have the values of the
bookmarks "Text1"-"Text5" in the form being sent as the
values of "label1"-label5" on the datasource. The data
comes across into the datasource document as "FORMTEXT"
followed by the value, so I'll have to find a way to
strip "FORMTEXT", then actually merge my datasource into
labels, but at least I'm getting somewhere.
  #5  
Old May 13th, 2005, 03:03 PM
Cindy M -WordMVP-
external usenet poster
 
Posts: n/a
Default

HI Mary

Sorry for the very late response, but I've been busy
recently and haven't had lots of "brain capacity" for
questions that require a lot of thought. It also doesn't
help that your reply is at the very bottom when I "flash
through" the unread messages.

Taking the first, and simple question, first:

What's the web address for the vba beginners site
you mentioned I should use?

Try:
news://msnews.microsoft.com/microsof...word.vba.begin
ners

Beyond that, you do know that a set of labels is really
just a table set out to emulate a label sheet, right?

So, as long as you're needing to pull the data from a form
field, rather than put it into a data source table, then
perform a mail merge, why not write it directly into the
label sheet (table in a Word document)?

The syntax to pick up information from a text form field
is:

sStringVar =
ActiveDocument.Formfields("Textboxname").Result

I'm sure this doesn't answer all your questions, but it at
least gives us a place to start...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
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
:-)

  #6  
Old May 14th, 2005, 09:09 AM
Doug Robbins
external usenet poster
 
Posts: n/a
Default

Hi Mary,

It will be easier for us to help you if you copy and paste the code of the
macro that you have developed into a message that you post back here.

--
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Mary" wrote in message
...

-----Original Message-----
Hi Mary,

I'm creating a form that our clients can fill out in
Microsoft Word. I've been asked that our clients be

able
to print labels from this form as well, grabbing
information from a particular field on the form. The
field's name is "FieldNo." The label "FieldNo" is not

in
the first row of the form, it's half-way down the

page.
I don't want the clients to go through a mailmerge
process, I'd like them to be able to choose a button

that
says "Print Labels", and the labels will print. We're
going to use Avery 8160 for the labels. The client

will
enter 1 or more field nos. in the field no. column.

I'm
guessing I'll need to create a macro to do this, but

I'm
a macro rookie.

A couple of questions

1. Version of Word?

2. Is this a form created using the Forms toolbar, or
something else?

3. If you're in a regular document (not protected as a
form), does the Tools/Envelopes and Labels/Labels

command do
basically what you need?

Note: the correct place to get help on macros if you've

no
experience is the word.vba.beginners newsgroup.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update

Jun
8 2004)
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
:-)

.

Hi again Cindy,

I just wanted to tell you I've made some progress since
the last post. I have my datasource opening from a macro
in my form, and I have the values of the
bookmarks "Text1"-"Text5" in the form being sent as the
values of "label1"-label5" on the datasource. The data
comes across into the datasource document as "FORMTEXT"
followed by the value, so I'll have to find a way to
strip "FORMTEXT", then actually merge my datasource into
labels, but at least I'm getting somewhere.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is There a Macro Command to Refresh Form Before Printing Report?? [email protected] Using Forms 2 May 21st, 2005 08:26 PM
Design help, please SillySally Using Forms 27 March 6th, 2005 04:11 AM
dlookup miaplacidus Using Forms 9 August 5th, 2004 09:16 PM
auto entry into second table after update Tony New Users 13 July 9th, 2004 10:42 PM
Problems Printing Mailing Labels... Grim Reaper Setting Up & Running Reports 0 May 19th, 2004 12:31 AM


All times are GMT +1. The time now is 11:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.