Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

Pause and input

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sharon - 10 Aug 2005 17:31 GMT
I want to create a macro that pauses at a certain spot and allows me to enter
in a unique number and then continue the macro.

It appears as if I am not the only one that is trying to do this as
evidenced by the questions in the discussion group, but I am not
understanding why this is so difficult.  I believe the the old versions of
Word did this (or was it WordPerfect)?  Anyway, I can think of a million
times that this would have been the best way to generate a form.  For
instance, run the macro (pause and enter info), continue to run macro (pause
and enter other infor) continue to run macro, etc.  

Maybe a macro is not the place to do that, but I personally don't like the
form fields in Word and would prefer to automatically generate the document
from a macro.  For example, I have a template letter to a client, I would
like to fire a macro and have it generate the letterhead information, pause
and ask me to input a name (which is in turn tied to another macro?),
continue with the letter and pause and ask for a certain date for example to
be inputted, continue with the rest of the letter and then pause for
insertion of the person who is signing the letter and then complete the rest
of the information for the letter.  

Any ideas?

Thanks.
Signature

S

Ed - 10 Aug 2005 17:51 GMT
Hi, Sharon.

> I want to create a macro that pauses at a certain spot and allows me to enter
> in a unique number and then continue the macro.

> For example, I have a template letter to a client, I would
> like to fire a macro and have it generate the letterhead information, pause
[quoted text clipped - 3 lines]
> insertion of the person who is signing the letter and then complete the rest
> of the information for the letter.

At its most basic, one of the easiest ways to do this is to insert an
InputBox at the appropriate points in your code.

> It appears as if I am not the only one that is trying to do this as
> evidenced by the questions in the discussion group, but I am not
> understanding why this is so difficult.

> Maybe a macro is not the place to do that, but I personally don't like the
> form fields in Word and would prefer to automatically generate the document
> from a macro.

That's part of the reason why so many people find this difficult:  Word
works *this* way, but people wish it to work *that* way.  It's the same with
a lot of things - features and functions vary.

For other "pause and input" situations, you can call a modeless UserForm
whose "Continue" button closes the form and continues the macro.

HTH
Ed
Jay Freedman - 10 Aug 2005 18:18 GMT
> Hi, Sharon.
>
[quoted text clipped - 31 lines]
> HTH
> Ed

Another method -- the one most "in tune" with the way Word works -- is to
display a single UserForm (or a series of them) that gathers all the
information needed to create the letter. When the user clicks the OK button,
each piece of information from the UserForm is inserted at a predefined
place (bookmark, form field, or other place) in the body of the letter,
which is a copy of the body of the template. The code that does this job can
also validate the data, format it, save it for later use, and a number of
other useful things.

See these articles to get started:

http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
http://www.dragondrop.com/wordcoding/word011a.asp

Signature

Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org

Sharon - 10 Aug 2005 18:31 GMT
Thanks Jay! :O)  I am printing the articles right now!  I always appreciate
new ideas and faster ways to do things!  Thanks.

Right now I am using an Access database with fields to populate a form.  
That works great when you have a lot of documents, but when you are only
doing one form and it only has a couple of fields, it sometimes seems as if
it would be easier than opening the database, choosing the record from a
receipient list etc. . . .  
Signature

S

> > Hi, Sharon.
> >
[quoted text clipped - 45 lines]
> http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
> http://www.dragondrop.com/wordcoding/word011a.asp
Sharon - 10 Aug 2005 18:36 GMT
People are always directing me to a 12 Step program! :O) j/k.
Signature

S

> Thanks Jay! :O)  I am printing the articles right now!  I always appreciate
> new ideas and faster ways to do things!  Thanks.
[quoted text clipped - 54 lines]
> > http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
> > http://www.dragondrop.com/wordcoding/word011a.asp
Doug Robbins - 10 Aug 2005 20:00 GMT
12 steps = 1 stride

Signature

Hope this helps.

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

Doug Robbins - Word MVP

> People are always directing me to a 12 Step program! :O) j/k.
>
[quoted text clipped - 62 lines]
>> > http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
>> > http://www.dragondrop.com/wordcoding/word011a.asp
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.