MS Office Forum / Word / Programming / October 2006
Pause a Macro
|
|
Thread rating:  |
lizaboop715@hotmail.com - 09 Oct 2006 13:58 GMT Why doesn't the PAUSE work in MS Word?
elizabeth
TedMi - 09 Oct 2006 16:01 GMT Please be more specific. Where are you trying to use it? How does it not work? Word version?
 Signature Ted
Jonathan West - 09 Oct 2006 17:37 GMT > Why doesn't the PAUSE work in MS Word? > > elizabeth Because you are running Word, not WordPerfect.
It's not that it doesn't work, it is just that Word works differently, and there isn't a one-to-one feature equivalence for everything. What are you trying to achieve?
 Signature Regards Jonathan West - Word MVP www.intelligentdocuments.co.uk Please reply to the newsgroup Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
lizaboop715@hotmail.com - 09 Oct 2006 19:07 GMT I want to have a macro that allows me to input text when I run it. I'm using MS Word. When I have the macro recorder opened, PAUSE is an option. When I run/play the macro, it doesn't stop for me to input text. Since it gives me the option to PAUSE, it should pause.
From the posts that I have read, I am not the only one having this problem. On 8/10/2005 9:30 AM PST Sharon was also asking the same question.
> > Why doesn't the PAUSE work in MS Word? > > [quoted text clipped - 5 lines] > there isn't a one-to-one feature equivalence for everything. What are you > trying to achieve? Jonathan West - 09 Oct 2006 23:39 GMT >I want to have a macro that allows me to input text when I run it. I'm >using [quoted text clipped - 7 lines] > problem. > On 8/10/2005 9:30 AM PST Sharon was also asking the same question. The fact that you can pause the process of recording a macro doesn't mean that a pause is put into the macro when it is executed.
if you want the macro to stop while you type something, you have two possibilities.
1. Use 2 macros. Run the first one. Type something. Run the second one.
2. Use an InputBox (look it up in the VBA help). Type into the inputbox, and have the macro put the text into the document wherever you want it to go.
Actually, there is a third more sophisticated option, to use a modeless userform, but that takes more programming.
 Signature Regards Jonathan West - Word MVP www.intelligentdocuments.co.uk Please reply to the newsgroup Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
lizaboop715@hotmail.com - 09 Oct 2006 23:25 GMT I know very well what program I'm using.
> > Why doesn't the PAUSE work in MS Word? > > [quoted text clipped - 5 lines] > there isn't a one-to-one feature equivalence for everything. What are you > trying to achieve? lizaboop715@hotmail.com - 09 Oct 2006 19:12 GMT Do you have the PAUSE option when you open the macro recorder? The PAUSE option is not only on my home computer, it is on every version of MS Word that I have used in the workplace. I want to record a macro, use the PAUSE option to input text, close the recorder, run/play the macro and have the macro pause so that I can input text. If the PAUSE feature doesn't work, why is it an option on the recorder?
elizabeth
> Why doesn't the PAUSE work in MS Word? > > elizabeth Karl E. Peterson - 09 Oct 2006 22:50 GMT > Do you have the PAUSE option when you open the macro recorder? The > PAUSE option is not only on my home computer, it is on every version [quoted text clipped - 3 lines] > If the PAUSE feature doesn't work, why is it an option on the > recorder? It works just fine, even according to your own description! It stops recording the macro, you enter some text, press Record again, and the macro recording resumes. What part of that do you consider to be "does not work"?
Seems to me, what's broken here is your own assumption about how a computer program operates. Here's what you need to consider. If the Pause button were to operate as you had assumed, how were you intending to indicate at what point the macro exection should resume? I mean, after XX seconds? YY keystrokes? It's a ludicrous notion.
 Signature Working without a .NET? http://classicvb.org/
lizaboop715@hotmail.com - 09 Oct 2006 23:24 GMT What is the purpose of the PAUSE option? When I run the macro, it does not pause for me to insert text; the entire macro runs from beginning to end.
> > Do you have the PAUSE option when you open the macro recorder? The > > PAUSE option is not only on my home computer, it is on every version [quoted text clipped - 13 lines] > what point the macro exection should resume? I mean, after XX seconds? YY > keystrokes? It's a ludicrous notion. Karl E. Peterson - 09 Oct 2006 23:33 GMT > What is the purpose of the PAUSE option? I honestly believe I just explained that to you. Did you read my initial reply?
To try drilling this point through -- it *PAUSES* the macro recording operation.
Perhaps I should put it this way? It pauses the macro *RECORDING* operation!
Clearer yet?
> When I run the macro, it does not pause for me to insert text; > the entire macro runs from beginning to end. That would be correct, yes.
 Signature Working without a .NET? http://classicvb.org/
lizaboop715@hotmail.com - 10 Oct 2006 00:01 GMT WHEN I RUN THE MACRO, WHY DOESN'T IT PAUSE FOR ME TO INPUT TEXT? MACROS ARE SUPPOSED TO AUTOMATE TASKS, NOT MAKE THEM TAKE LONGER. I HAVE WORKED ON DOCUMENTS IN MS WORD THAT WOULD HAVE TAKEN 2 OR 3 SECONDS IF THE MACRO WOULD PAUSE FOR USER INPUT; INSTEAD IT'S QUICKER FOR ME TO KEEP RETYPING THE TEXT. IT'S RIDICULOUS. IT'S SO TIME CONSUMING. PLEASE DON'T ADVISE ME TO USE THE ONLINE FORMS; I'M BETTER OFF TYPING AND RETYPING AND RETYPING AND RETYPING.
> > What is the purpose of the PAUSE option? > [quoted text clipped - 13 lines] > > That would be correct, yes. Karl E. Peterson - 10 Oct 2006 00:16 GMT > WHEN I RUN THE MACRO, WHY DOESN'T IT PAUSE FOR ME TO INPUT TEXT? Tsk, no need to yell. :-)
You're confusing numerous issues here. To be as concise as possible, it doesn't stop because you didn't *code* it to stop. Macros only do what you tell them to do. Have you ever looked at the results of your macro recording sessions? Do you understand what each line of code in there is doing?
> MACROS ARE SUPPOSED TO AUTOMATE TASKS, NOT MAKE THEM TAKE LONGER. I > HAVE WORKED ON DOCUMENTS IN MS WORD THAT WOULD HAVE TAKEN 2 OR 3 > SECONDS IF THE MACRO WOULD PAUSE FOR USER INPUT; INSTEAD IT'S QUICKER > FOR ME TO KEEP RETYPING THE TEXT. IT'S RIDICULOUS. IT'S SO TIME > CONSUMING. PLEASE DON'T ADVISE ME TO USE THE ONLINE FORMS; I'M > BETTER OFF TYPING AND RETYPING AND RETYPING AND RETYPING. You may indeed be right.
 Signature Working without a .NET? http://classicvb.org/
lizaboop715@hotmail.com - 10 Oct 2006 00:50 GMT I REALLY need to create a macro that I a can run with user input. I am not confusing any issues. Plain and simple--I REALLY need to create a macro that I a can run with user input.
> > WHEN I RUN THE MACRO, WHY DOESN'T IT PAUSE FOR ME TO INPUT TEXT? > [quoted text clipped - 14 lines] > > You may indeed be right. Karl E. Peterson - 10 Oct 2006 02:33 GMT > I REALLY need to create a macro that I a can run with user input. I > am not confusing any issues. Plain and simple--I REALLY need to > create a macro that I a can run with user input. As Jonathan so calmly pointed out, that goes far beyond the traditional boundaries of a "macro recording." I'd add that, if the user in question is actually you, and the input is invariate, you could hard code it directly into the skeletal outline provided by the macro recorder.
Maybe it'd help if you viewed the recording mechanism more as a means to discovery and not something that ultimately provides you a functionally useful solution? By recording a series of actions, you are able to open the IDE and see how a machine translates what you did into code that the machine itself can subsequently understand. But *always* view it as the very beginning, and never the end, in your pursuit of a solution.
 Signature Working without a .NET? http://classicvb.org/
bztips - 10 Oct 2006 22:03 GMT This is hilarious. Elizabeth, I'm looking forward to your next insightful comment!
> > I REALLY need to create a macro that I a can run with user input. I > > am not confusing any issues. Plain and simple--I REALLY need to [quoted text clipped - 11 lines] > itself can subsequently understand. But *always* view it as the very > beginning, and never the end, in your pursuit of a solution. lizaboop715@hotmail.com - 10 Oct 2006 00:27 GMT I am presently working at a job where I get at least 25 emails, each with an attachment (each attachment is different) in MS Word, that I have to edit by inserting various names and titles in certain places. I should be able to create a macro to insert the name(s) and or title(s) by using user input. That's what a macro is supposed to do--make the task quicker.
> > What is the purpose of the PAUSE option? > [quoted text clipped - 13 lines] > > That would be correct, yes. Karl E. Peterson - 10 Oct 2006 00:35 GMT > I am presently working at a job where I get at least 25 emails, each > with an attachment (each attachment is different) in MS Word, that I > have to edit by inserting various names and titles in certain places. > I should be able to create a macro to insert the name(s) and or > title(s) by using user input. That's what a macro is supposed to > do--make the task quicker. Yep! Definitely.
 Signature Working without a .NET? http://classicvb.org/
Jonathan West - 10 Oct 2006 01:31 GMT >I am presently working at a job where I get at least 25 emails, each with >an [quoted text clipped - 3 lines] > create a macro to insert the name(s) and or title(s) by using user input. > That's what a macro is supposed to do--make the task quicker. To do that you are going to have to do a bit more than just use the recorder. You are going to have to get your feet wet with a little bit of programming.
Take a look at these two articles.
Getting To Grips With VBA Basics In 15 Minutes http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm
Creating a macro with no programming experience using the recorder http://www.word.mvps.org/FAQs/MacrosVBA/UsingRecorder.htm
When you are happy you understand those reasonably well, look up the InputBox function in the VBA Help. This is what you can use to get the user to type in information.
 Signature Regards Jonathan West - Word MVP www.intelligentdocuments.co.uk Please reply to the newsgroup Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Shauna Kelly - 10 Oct 2006 23:22 GMT Hi Lizaboop715
>I should be able to ... insert the name(s) and or title(s) by using user >input. It's possible that you don't need a macro at all. You may be better with an AutoText and an Fill-in field.
See the following for some info on this (if the link breaks in translation, you'll have to glue it back together again): http://groups.google.com.au/group/microsoft.public.word.newusers/browse_thread/t hread/d090ae12701ca76d/0a24bc07b1e48e72?lnk=st&q=&rnum=3&hl=en#0a24bc07b1e48e72
Hope this helps.
Shauna Kelly. Microsoft MVP. http://www.shaunakelly.com/word
>I am presently working at a job where I get at least 25 emails, each with >an [quoted text clipped - 21 lines] >> >> That would be correct, yes.
|
|
|