I want to put a macro in a template I have (Word 2003). I open the template
and go to Tools>Macros>Record Macro. I assign the macro a name and tell Word
I want to store it in this template. Then I record the macro. I save and
close the template.

I open a new document from that template and sure enough, there's the text
of my macro, just as I typed it. It doesn't do anything â?? it just sits there
in the template, for all the world to see.

What (or should I say how many things) have I done wrong?

--
Wallace

Re: A very visually basic question by Charles

Charles
Thu Feb 16 13:09:07 CST 2006

First, don't use macros for repeating text. Its the wrong tool. Use AutoText
or AutoCorrect.

It sounds like you saved your template with the text showing. When you
create a new document based on a template, it will show whatever text is in
the template.

http://word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm
http://word.mvps.org/FAQs/Customization/AutoCorrect.htm
http://word.mvps.org/FAQs/Customization/AutoText.htm

For more on the different kinds of templates, tabs on the file new dialog,
and locations of templates folders see
http://addbalance.com/usersguide/templates.htm.

I suspect that you have moved from Word Perfect, where macros are used to
repeat text. If so and if you would like some suggestions on making Word
easier to use, reply back.
--

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://word.mvps.org/FAQs/ 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.

"Wallace" <wallace@discussions.microsoft.com> wrote in message
news:9B7D0B57-D194-44A8-8067-954AC23BC813@microsoft.com...
>I want to put a macro in a template I have (Word 2003). I open the template
> and go to Tools>Macros>Record Macro. I assign the macro a name and tell
> Word
> I want to store it in this template. Then I record the macro. I save and
> close the template.
>
> I open a new document from that template and sure enough, there's the text
> of my macro, just as I typed it. It doesn't do anything - it just sits
> there
> in the template, for all the world to see.
>
> What (or should I say how many things) have I done wrong?
>
> --
> Wallace



Re: A very visually basic question by Tony

Tony
Thu Feb 16 13:29:08 CST 2006

Nothing in your description of what you have done mentions typing anything
so what do you mean when you say that the text of your macro is "just as I
typed it"?

--
Enjoy,
Tony


"Wallace" <wallace@discussions.microsoft.com> wrote in message
news:9B7D0B57-D194-44A8-8067-954AC23BC813@microsoft.com...
> I want to put a macro in a template I have (Word 2003). I open the
template
> and go to Tools>Macros>Record Macro. I assign the macro a name and tell
Word
> I want to store it in this template. Then I record the macro. I save and
> close the template.
>
> I open a new document from that template and sure enough, there's the text
> of my macro, just as I typed it. It doesn't do anything - it just sits
there
> in the template, for all the world to see.
>
> What (or should I say how many things) have I done wrong?
>
> --
> Wallace



Re: A very visually basic question by wallace

wallace
Fri Feb 17 08:31:29 CST 2006

Okay, here is what I want to do. I want to create a template from which
documents will open to Track Changes "Final" rather than "Final Showing
Markup."
I have attempted to load this simple macro into the template:

Sub AutoOpen()
'Change Tracked Changes to Final View
With ActiveWindow.View
.ShowRevisionsAndComments = False
.RevisionsView = wdRevisionsViewFinal
End With
End Sub

As I mentioned, now when I open a document based on this template, the text
of the macro appears, but the Display for Review Window still shows "Final
Showing Markup."

So I need to have the macro *execute* when the document opens, not sit there
in the document itself, staring me in the face! Of course, when I go to the
macros library and run this macro from there, it works. But what's the point
of that? I can do the same thing by clicking the down arrow and changing the
view in the Track Changes window.

Anyway, that's my problem, and I appreciate those of you who have offered
suggestions.
--
Wallace


"Tony Jollans" wrote:

> Nothing in your description of what you have done mentions typing anything
> so what do you mean when you say that the text of your macro is "just as I
> typed it"?
>
> --
> Enjoy,
> Tony
>
>
> "Wallace" <wallace@discussions.microsoft.com> wrote in message
> news:9B7D0B57-D194-44A8-8067-954AC23BC813@microsoft.com...
> > I want to put a macro in a template I have (Word 2003). I open the
> template
> > and go to Tools>Macros>Record Macro. I assign the macro a name and tell
> Word
> > I want to store it in this template. Then I record the macro. I save and
> > close the template.
> >
> > I open a new document from that template and sure enough, there's the text
> > of my macro, just as I typed it. It doesn't do anything - it just sits
> there
> > in the template, for all the world to see.
> >
> > What (or should I say how many things) have I done wrong?
> >
> > --
> > Wallace
>
>
>

Re: A very visually basic question by Tony

Tony
Fri Feb 17 11:18:43 CST 2006

Such a macro ought to work. Where have you put it?

I'm rather confused by what you say (that it is in the document) but you
mention that you recorded it so it should be in a module (probably
"NewMacros") in your template - or is it in Normal.dot?

--
Enjoy,
Tony


"Wallace" <wallace@discussions.microsoft.com> wrote in message
news:2E3F5DD5-1A76-40E6-9E54-301185B71E22@microsoft.com...
> Okay, here is what I want to do. I want to create a template from which
> documents will open to Track Changes "Final" rather than "Final Showing
> Markup."
> I have attempted to load this simple macro into the template:
>
> Sub AutoOpen()
> 'Change Tracked Changes to Final View
> With ActiveWindow.View
> .ShowRevisionsAndComments = False
> .RevisionsView = wdRevisionsViewFinal
> End With
> End Sub
>
> As I mentioned, now when I open a document based on this template, the
text
> of the macro appears, but the Display for Review Window still shows "Final
> Showing Markup."
>
> So I need to have the macro *execute* when the document opens, not sit
there
> in the document itself, staring me in the face! Of course, when I go to
the
> macros library and run this macro from there, it works. But what's the
point
> of that? I can do the same thing by clicking the down arrow and changing
the
> view in the Track Changes window.
>
> Anyway, that's my problem, and I appreciate those of you who have offered
> suggestions.
> --
> Wallace
>
>
> "Tony Jollans" wrote:
>
> > Nothing in your description of what you have done mentions typing
anything
> > so what do you mean when you say that the text of your macro is "just as
I
> > typed it"?
> >
> > --
> > Enjoy,
> > Tony
> >
> >
> > "Wallace" <wallace@discussions.microsoft.com> wrote in message
> > news:9B7D0B57-D194-44A8-8067-954AC23BC813@microsoft.com...
> > > I want to put a macro in a template I have (Word 2003). I open the
> > template
> > > and go to Tools>Macros>Record Macro. I assign the macro a name and
tell
> > Word
> > > I want to store it in this template. Then I record the macro. I save
and
> > > close the template.
> > >
> > > I open a new document from that template and sure enough, there's the
text
> > > of my macro, just as I typed it. It doesn't do anything - it just sits
> > there
> > > in the template, for all the world to see.
> > >
> > > What (or should I say how many things) have I done wrong?
> > >
> > > --
> > > Wallace
> >
> >
> >



Re: A very visually basic question by wallace

wallace
Fri Feb 17 12:11:30 CST 2006

Tony:

It's in Normal.dot.

But now I have a new problem. When I attempt to run it, I get error message
#91: "Object variable or With block variable not set." I thought the With ...
End With block was properly defined, but VBA seems to disagree.
--
Wallace


"Tony Jollans" wrote:

> Such a macro ought to work. Where have you put it?
>
> I'm rather confused by what you say (that it is in the document) but you
> mention that you recorded it so it should be in a module (probably
> "NewMacros") in your template - or is it in Normal.dot?
>
> --
> Enjoy,
> Tony
>
>
> "Wallace" <wallace@discussions.microsoft.com> wrote in message
> news:2E3F5DD5-1A76-40E6-9E54-301185B71E22@microsoft.com...
> > Okay, here is what I want to do. I want to create a template from which
> > documents will open to Track Changes "Final" rather than "Final Showing
> > Markup."
> > I have attempted to load this simple macro into the template:
> >
> > Sub AutoOpen()
> > 'Change Tracked Changes to Final View
> > With ActiveWindow.View
> > .ShowRevisionsAndComments = False
> > .RevisionsView = wdRevisionsViewFinal
> > End With
> > End Sub
> >
> > As I mentioned, now when I open a document based on this template, the
> text
> > of the macro appears, but the Display for Review Window still shows "Final
> > Showing Markup."
> >
> > So I need to have the macro *execute* when the document opens, not sit
> there
> > in the document itself, staring me in the face! Of course, when I go to
> the
> > macros library and run this macro from there, it works. But what's the
> point
> > of that? I can do the same thing by clicking the down arrow and changing
> the
> > view in the Track Changes window.
> >
> > Anyway, that's my problem, and I appreciate those of you who have offered
> > suggestions.
> > --
> > Wallace
> >
> >
> > "Tony Jollans" wrote:
> >
> > > Nothing in your description of what you have done mentions typing
> anything
> > > so what do you mean when you say that the text of your macro is "just as
> I
> > > typed it"?
> > >
> > > --
> > > Enjoy,
> > > Tony
> > >
> > >
> > > "Wallace" <wallace@discussions.microsoft.com> wrote in message
> > > news:9B7D0B57-D194-44A8-8067-954AC23BC813@microsoft.com...
> > > > I want to put a macro in a template I have (Word 2003). I open the
> > > template
> > > > and go to Tools>Macros>Record Macro. I assign the macro a name and
> tell
> > > Word
> > > > I want to store it in this template. Then I record the macro. I save
> and
> > > > close the template.
> > > >
> > > > I open a new document from that template and sure enough, there's the
> text
> > > > of my macro, just as I typed it. It doesn't do anything - it just sits
> > > there
> > > > in the template, for all the world to see.
> > > >
> > > > What (or should I say how many things) have I done wrong?
> > > >
> > > > --
> > > > Wallace
> > >
> > >
> > >
>
>
>

Re: A very visually basic question by Tony

Tony
Fri Feb 17 13:36:30 CST 2006

If you want it to run when documents based on a particular template are
opened, it must be in that template. If it's in Normal it will run when
documents based on Normal are opened - not documents based on other
templates.

Create a new module in your template and move the code into that.

Not sure about your error - did you have a document open at the time?

--
Enjoy,
Tony


"Wallace" <wallace@discussions.microsoft.com> wrote in message
news:80E4D991-C04E-4804-ABA2-19AEB27AC051@microsoft.com...
> Tony:
>
> It's in Normal.dot.
>
> But now I have a new problem. When I attempt to run it, I get error
message
> #91: "Object variable or With block variable not set." I thought the With
...
> End With block was properly defined, but VBA seems to disagree.
> --
> Wallace
>
>
> "Tony Jollans" wrote:
>
> > Such a macro ought to work. Where have you put it?
> >
> > I'm rather confused by what you say (that it is in the document) but you
> > mention that you recorded it so it should be in a module (probably
> > "NewMacros") in your template - or is it in Normal.dot?
> >
> > --
> > Enjoy,
> > Tony
> >
> >
> > "Wallace" <wallace@discussions.microsoft.com> wrote in message
> > news:2E3F5DD5-1A76-40E6-9E54-301185B71E22@microsoft.com...
> > > Okay, here is what I want to do. I want to create a template from
which
> > > documents will open to Track Changes "Final" rather than "Final
Showing
> > > Markup."
> > > I have attempted to load this simple macro into the template:
> > >
> > > Sub AutoOpen()
> > > 'Change Tracked Changes to Final View
> > > With ActiveWindow.View
> > > .ShowRevisionsAndComments = False
> > > .RevisionsView = wdRevisionsViewFinal
> > > End With
> > > End Sub
> > >
> > > As I mentioned, now when I open a document based on this template, the
> > text
> > > of the macro appears, but the Display for Review Window still shows
"Final
> > > Showing Markup."
> > >
> > > So I need to have the macro *execute* when the document opens, not sit
> > there
> > > in the document itself, staring me in the face! Of course, when I go
to
> > the
> > > macros library and run this macro from there, it works. But what's the
> > point
> > > of that? I can do the same thing by clicking the down arrow and
changing
> > the
> > > view in the Track Changes window.
> > >
> > > Anyway, that's my problem, and I appreciate those of you who have
offered
> > > suggestions.
> > > --
> > > Wallace
> > >
> > >
> > > "Tony Jollans" wrote:
> > >
> > > > Nothing in your description of what you have done mentions typing
> > anything
> > > > so what do you mean when you say that the text of your macro is
"just as
> > I
> > > > typed it"?
> > > >
> > > > --
> > > > Enjoy,
> > > > Tony
> > > >
> > > >
> > > > "Wallace" <wallace@discussions.microsoft.com> wrote in message
> > > > news:9B7D0B57-D194-44A8-8067-954AC23BC813@microsoft.com...
> > > > > I want to put a macro in a template I have (Word 2003). I open the
> > > > template
> > > > > and go to Tools>Macros>Record Macro. I assign the macro a name and
> > tell
> > > > Word
> > > > > I want to store it in this template. Then I record the macro. I
save
> > and
> > > > > close the template.
> > > > >
> > > > > I open a new document from that template and sure enough, there's
the
> > text
> > > > > of my macro, just as I typed it. It doesn't do anything - it just
sits
> > > > there
> > > > > in the template, for all the world to see.
> > > > >
> > > > > What (or should I say how many things) have I done wrong?
> > > > >
> > > > > --
> > > > > Wallace
> > > >
> > > >
> > > >
> >
> >
> >



Re: A very visually basic question by Barry

Barry
Fri Feb 17 23:49:56 CST 2006

On Thu, 16 Feb 2006 10:58:28 -0800, "Wallace"
<wallace@discussions.microsoft.com> wrote:

>I want to put a macro in a template I have (Word 2003). I open the template
>and go to Tools>Macros>Record Macro. I assign the macro a name and tell Word
>I want to store it in this template. Then I record the macro. I save and
>close the template.
>
>I open a new document from that template and sure enough, there's the text
>of my macro, just as I typed it. It doesn't do anything ? it just sits there
>in the template, for all the world to see.
>
>What (or should I say how many things) have I done wrong?

I think you need to create a template, open a DOCUMENT from that
template, and then record your macro and save it in the template.


Remove del for email