#1   Report Post  
mully
 
Posts: n/a
Default User Form Tasks

Hi All

In MailMerge I have used details from an Excel Sheet which has several
columns with Name/ Address/ Contact Info etc. I have created the MailMerge
into 3 templates i.e. Labels / Letter / Permit. If I create a user form with
3 Command Buttons named respectively Labels / Letter / Permit and on clicking
the respective buttons it will open the template ready for use e.g. click on
Labels and the whole shebang opens ready to print the 250 or so Labels.
What code would I need to put in the VBA Modules.

To take it a stage further we have a User Form in Excel is it possible to
put 3 extra buttons on the Excel User Form and go straight into MailMerge as
above.

Any help much appreciated

Cheers ------ Mully

  #2   Report Post  
Charles Kenyon
 
Posts: n/a
Default

First, do not "open" the templates. Create new documents based on them. This
is done with the Documents.Add command.

Second, you can do this within your Excel UserForm so long as you specify
the application (Word) and it is available.

I'm not about to write your code for you without being paid (and you can
find better and cheaper programmers). However, take a look at
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm,
http://word.mvps.org/FAQs/MacrosVBA/...csIn15Mins.htm and
http://word.mvps.org/FAQs/MacrosVBA/...csIn15Mins.htm. What I would do
if I were attempting to write your code would probably be to start by
recording a macro for each of your templates that (1) creates a new document
based on the template, (2) performs a merge with your data and possibly (3)
prints your new merged document. Save the macros and use them as a starting
point. That would at least give the appropriate collections and commands
although it would probably have a lot of excess code. I would then work on
cleaning out the excess and modifying the code so it would work in your
Excel form. http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm
http://word.mvps.org/FAQs/InterDev/C...WordFromXL.htm

Hope this helps get you started. Once you have actual code if you run into
problems, post back in the word.vba.beginners or word.vba.userforms
newsgroups.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"mully" wrote in message
...
Hi All

In MailMerge I have used details from an Excel Sheet which has several
columns with Name/ Address/ Contact Info etc. I have created the MailMerge
into 3 templates i.e. Labels / Letter / Permit. If I create a user form
with
3 Command Buttons named respectively Labels / Letter / Permit and on
clicking
the respective buttons it will open the template ready for use e.g. click
on
Labels and the whole shebang opens ready to print the 250 or so Labels.
What code would I need to put in the VBA Modules.

To take it a stage further we have a User Form in Excel is it possible to
put 3 extra buttons on the Excel User Form and go straight into MailMerge
as
above.

Any help much appreciated

Cheers ------ Mully



  #3   Report Post  
mully
 
Posts: n/a
Default

Hi

I have done as you suggested and made templates of the originals and started
to write the macro's - if anything doesn't fall in to place will come back
with the questions. Thanks again

Mully

"Charles Kenyon" wrote:

First, do not "open" the templates. Create new documents based on them. This
is done with the Documents.Add command.

Second, you can do this within your Excel UserForm so long as you specify
the application (Word) and it is available.

I'm not about to write your code for you without being paid (and you can
find better and cheaper programmers). However, take a look at
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm,
http://word.mvps.org/FAQs/MacrosVBA/...csIn15Mins.htm and
http://word.mvps.org/FAQs/MacrosVBA/...csIn15Mins.htm. What I would do
if I were attempting to write your code would probably be to start by
recording a macro for each of your templates that (1) creates a new document
based on the template, (2) performs a merge with your data and possibly (3)
prints your new merged document. Save the macros and use them as a starting
point. That would at least give the appropriate collections and commands
although it would probably have a lot of excess code. I would then work on
cleaning out the excess and modifying the code so it would work in your
Excel form. http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm
http://word.mvps.org/FAQs/InterDev/C...WordFromXL.htm

Hope this helps get you started. Once you have actual code if you run into
problems, post back in the word.vba.beginners or word.vba.userforms
newsgroups.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"mully" wrote in message
...
Hi All

In MailMerge I have used details from an Excel Sheet which has several
columns with Name/ Address/ Contact Info etc. I have created the MailMerge
into 3 templates i.e. Labels / Letter / Permit. If I create a user form
with
3 Command Buttons named respectively Labels / Letter / Permit and on
clicking
the respective buttons it will open the template ready for use e.g. click
on
Labels and the whole shebang opens ready to print the 250 or so Labels.
What code would I need to put in the VBA Modules.

To take it a stage further we have a User Form in Excel is it possible to
put 3 extra buttons on the Excel User Form and go straight into MailMerge
as
above.

Any help much appreciated

Cheers ------ Mully




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MULTIPLE INSTANCES OF THE SAME BOOKMARK IN A USER FORM Carol Microsoft Word Help 20 October 3rd 06 12:41 AM
How do I allow a form user to insert pictures into a document WordFormChallenged Microsoft Word Help 0 April 28th 05 09:14 PM
allowing a user to attach a file to a form d. r. bond Microsoft Word Help 4 April 8th 05 07:57 PM
Adding Autotext in a Macro User Form field Onka Microsoft Word Help 1 February 10th 05 05:39 AM
allow user to add text to an already existing form list field CK@PPC Microsoft Word Help 2 February 3rd 05 09:44 AM


All times are GMT +1. The time now is 08:13 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"