How does one set placement of cusor in template?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a MSWord Memo template then made the first section protected so the
when the template opened it would do so at the end of the first section.
The first section is comprised of the
Date: [creation date]
From: [name of person who will be using template]
To: [THIS IS WHERE I WANT THE CURSOR TO BE WHEN TEMPLATE OPENS]
right now it is at the beginning of the line.
[cursor] To:
In Access I was able to program it so in a field where the staff keep notes
the cursor is at the end of any exisiting text or if the field is blank it is
at the beginning.
SelStart
Please help. Thanks.
 
You can write an AutoNew macro to position the cursor where you want it; but
unless you have macro code in the template anyway the additional support and
installation burden of including macro code in a distributed template (all
those security warnings!) isn't justified by the very minor convenience that
the macro would provide.
 
Hi Joan:

1) Open the template you want to use.

2) Insert a bookmark at the place you want the cursor to go, named
appropriately (e.g. "macroLocate"). It doesn't matter what the name is so
long as you can remember it. But it's a good idea not to use a name you
might want to use later for some other bookmark.

3) Save the template.

4) Turn on the Macro Recorder

5) Type "AutoNew" as the name of the Macro and make sure you change the
"Save macro in" field to the name of your template. The macro must be named
AutoNew spelled just like that or it will not operate correctly.

6) Hit Ctrl + g, choose the name of the bookmark, then hit OK. You can't
record mouse or cursor movements, hence using Ctrl + g -- Go To -- And
choosing the name of the bookmark.

If you do this right, any time anyone creates a new document from that
template, the cursor will go where you put the bookmark. The AutoNew name
cause the macro to run each time a new document is created from the
template.

You will need to look up Macro Recorder in the Help. This isn't easy: you
may not get it right on the first attempt :-) Have a couple of tries then
get back to us if you have difficulty.

Cheers

I would still like to try. Would you please tell me how. Thanks.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst, Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 
Problem began with step 6 of your instructions.
1. I open template
2. Insert Bookmark, named it "macroLocate"
3. Saved the template [named it at same time]
4. Turned on Macro Record
5. Typed: "AutoNew"; Selected the document to be saved in. hit ok
6. typed Ctrl+g, selected name of bookmark;go to;ok
Stop recording macro.
The following may help you find what I did wrong. Been trying for 2hrs. : - (
Sub AutoNew()
'
' AutoNew Macro
' Macro recorded 1/28/2007 by Joan O'Callaghan
'
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub



--
Joan


John McGhie [MVP - Word and Word Macinto said:
Hi Joan:

1) Open the template you want to use.

2) Insert a bookmark at the place you want the cursor to go, named
appropriately (e.g. "macroLocate"). It doesn't matter what the name is so
long as you can remember it. But it's a good idea not to use a name you
might want to use later for some other bookmark.

3) Save the template.

4) Turn on the Macro Recorder

5) Type "AutoNew" as the name of the Macro and make sure you change the
"Save macro in" field to the name of your template. The macro must be named
AutoNew spelled just like that or it will not operate correctly.

6) Hit Ctrl + g, choose the name of the bookmark, then hit OK. You can't
record mouse or cursor movements, hence using Ctrl + g -- Go To -- And
choosing the name of the bookmark.

If you do this right, any time anyone creates a new document from that
template, the cursor will go where you put the bookmark. The AutoNew name
cause the macro to run each time a new document is created from the
template.

You will need to look up Macro Recorder in the Help. This isn't easy: you
may not get it right on the first attempt :-) Have a couple of tries then
get back to us if you have difficulty.

Cheers

I would still like to try. Would you please tell me how. Thanks.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst, Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 
Did you make sure to insert the bookmark and create the macro in the
template (*.dot file)? You cannot do this in a document created from
the template.

Note that you can remove the references to Selection.Find in the
recorded macro; all you need is this:

Sub AutoNew()
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
Problem began with step 6 of your instructions.
1. I open template
2. Insert Bookmark, named it "macroLocate"
3. Saved the template [named it at same time]
4. Turned on Macro Record
5. Typed: "AutoNew"; Selected the document to be saved in. hit ok
6. typed Ctrl+g, selected name of bookmark;go to;ok
Stop recording macro.
The following may help you find what I did wrong. Been trying for 2hrs. : - (
Sub AutoNew()
'
' AutoNew Macro
' Macro recorded 1/28/2007 by Joan O'Callaghan
'
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub



--
Joan


John McGhie [MVP - Word and Word Macinto said:
Hi Joan:

1) Open the template you want to use.

2) Insert a bookmark at the place you want the cursor to go, named
appropriately (e.g. "macroLocate"). It doesn't matter what the name is so
long as you can remember it. But it's a good idea not to use a name you
might want to use later for some other bookmark.

3) Save the template.

4) Turn on the Macro Recorder

5) Type "AutoNew" as the name of the Macro and make sure you change the
"Save macro in" field to the name of your template. The macro must be named
AutoNew spelled just like that or it will not operate correctly.

6) Hit Ctrl + g, choose the name of the bookmark, then hit OK. You can't
record mouse or cursor movements, hence using Ctrl + g -- Go To -- And
choosing the name of the bookmark.

If you do this right, any time anyone creates a new document from that
template, the cursor will go where you put the bookmark. The AutoNew name
cause the macro to run each time a new document is created from the
template.

You will need to look up Macro Recorder in the Help. This isn't easy: you
may not get it right on the first attempt :-) Have a couple of tries then
get back to us if you have difficulty.

Cheers

I would still like to try. Would you please tell me how.
Thanks.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst, Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 
I did as you suggested.
It did get rid of unwanted toolbars that were appearing after I stopped
running the macro when I saved an opened the template.
Yes, I am working with a template.
Problem now: When I open the template the cursor precedes the word Memo.
How do I get rid of it?
*Memo
To: *bookmark
Thanks for your help.
Shall look forward to reply.

--
Joan


Stefan Blom said:
Did you make sure to insert the bookmark and create the macro in the
template (*.dot file)? You cannot do this in a document created from
the template.

Note that you can remove the references to Selection.Find in the
recorded macro; all you need is this:

Sub AutoNew()
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
Problem began with step 6 of your instructions.
1. I open template
2. Insert Bookmark, named it "macroLocate"
3. Saved the template [named it at same time]
4. Turned on Macro Record
5. Typed: "AutoNew"; Selected the document to be saved in. hit ok
6. typed Ctrl+g, selected name of bookmark;go to;ok
Stop recording macro.
The following may help you find what I did wrong. Been trying for 2hrs. : - (
Sub AutoNew()
'
' AutoNew Macro
' Macro recorded 1/28/2007 by Joan O'Callaghan
'
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub



--
Joan


John McGhie [MVP - Word and Word Macinto said:
Hi Joan:

1) Open the template you want to use.

2) Insert a bookmark at the place you want the cursor to go, named
appropriately (e.g. "macroLocate"). It doesn't matter what the name is so
long as you can remember it. But it's a good idea not to use a name you
might want to use later for some other bookmark.

3) Save the template.

4) Turn on the Macro Recorder

5) Type "AutoNew" as the name of the Macro and make sure you change the
"Save macro in" field to the name of your template. The macro must be named
AutoNew spelled just like that or it will not operate correctly.

6) Hit Ctrl + g, choose the name of the bookmark, then hit OK. You can't
record mouse or cursor movements, hence using Ctrl + g -- Go To -- And
choosing the name of the bookmark.

If you do this right, any time anyone creates a new document from that
template, the cursor will go where you put the bookmark. The AutoNew name
cause the macro to run each time a new document is created from the
template.

You will need to look up Macro Recorder in the Help. This isn't easy: you
may not get it right on the first attempt :-) Have a couple of tries then
get back to us if you have difficulty.

Cheers

On 24/1/07 5:05 AM, in article
(e-mail address removed), "JoanOC"

I would still like to try. Would you please tell me how. Thanks.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst, Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 
It seems as if you need to re-insert the bookmark in the correct
location. Place the insertion point at the desired location. On the
Insert menu, click Bookmark. Click the "macroLocate" name, and then
click Add. This moves the bookmark to the chosen location.

Note that you can display bookmarks in order to work with them more
easily: On the Tools menu, click Options. Click the View tab. Click to
check the "Bookmarks" option, and then click OK.

--
Stefan Blom
Microsoft Word MVP


in message
I did as you suggested.
It did get rid of unwanted toolbars that were appearing after I stopped
running the macro when I saved an opened the template.
Yes, I am working with a template.
Problem now: When I open the template the cursor precedes the word Memo.
How do I get rid of it?
*Memo
To: *bookmark
Thanks for your help.
Shall look forward to reply.

--
Joan


Stefan Blom said:
Did you make sure to insert the bookmark and create the macro in the
template (*.dot file)? You cannot do this in a document created from
the template.

Note that you can remove the references to Selection.Find in the
recorded macro; all you need is this:

Sub AutoNew()
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
Problem began with step 6 of your instructions.
1. I open template
2. Insert Bookmark, named it "macroLocate"
3. Saved the template [named it at same time]
4. Turned on Macro Record
5. Typed: "AutoNew"; Selected the document to be saved in. hit ok
6. typed Ctrl+g, selected name of bookmark;go to;ok
Stop recording macro.
The following may help you find what I did wrong. Been trying
for
2hrs. : - (
Sub AutoNew()
'
' AutoNew Macro
' Macro recorded 1/28/2007 by Joan O'Callaghan
'
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub



--
Joan


:

Hi Joan:

1) Open the template you want to use.

2) Insert a bookmark at the place you want the cursor to go, named
appropriately (e.g. "macroLocate"). It doesn't matter what
the
name is so
long as you can remember it. But it's a good idea not to use
a
name you
might want to use later for some other bookmark.

3) Save the template.

4) Turn on the Macro Recorder

5) Type "AutoNew" as the name of the Macro and make sure you change the
"Save macro in" field to the name of your template. The macro must be named
AutoNew spelled just like that or it will not operate correctly.

6) Hit Ctrl + g, choose the name of the bookmark, then hit
OK.
You can't
record mouse or cursor movements, hence using Ctrl + g -- Go
To --
And
choosing the name of the bookmark.

If you do this right, any time anyone creates a new document
from
that
template, the cursor will go where you put the bookmark. The AutoNew name
cause the macro to run each time a new document is created
from
the
template.

You will need to look up Macro Recorder in the Help. This
isn't
easy: you
may not get it right on the first attempt :-) Have a couple
of
tries then
get back to us if you have difficulty.

Cheers

On 24/1/07 5:05 AM, in article
(e-mail address removed), "JoanOC"

I would still like to try. Would you please tell me how. Thanks.
do
not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst, Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 
Doesn't work. The template I am working on is the Professional Memo.
Using the mouse I delete the cells containing the logo.
Then again using the mouse the click on the the insertion point at the tab
point after the word "To:" [I read someplace that you can't use mouse when
creating a macro, but I have not begun that process yet].
Could I be doing something wrong before I even start creating the macroLocate?
Frustrating.
I tried to view all the formating contained in the template, but couldn't
find any insertion/cursor point before the point where I want it.
Should I give up?

--
Joan


Stefan Blom said:
It seems as if you need to re-insert the bookmark in the correct
location. Place the insertion point at the desired location. On the
Insert menu, click Bookmark. Click the "macroLocate" name, and then
click Add. This moves the bookmark to the chosen location.

Note that you can display bookmarks in order to work with them more
easily: On the Tools menu, click Options. Click the View tab. Click to
check the "Bookmarks" option, and then click OK.

--
Stefan Blom
Microsoft Word MVP


in message
I did as you suggested.
It did get rid of unwanted toolbars that were appearing after I stopped
running the macro when I saved an opened the template.
Yes, I am working with a template.
Problem now: When I open the template the cursor precedes the word Memo.
How do I get rid of it?
*Memo
To: *bookmark
Thanks for your help.
Shall look forward to reply.

--
Joan


Stefan Blom said:
Did you make sure to insert the bookmark and create the macro in the
template (*.dot file)? You cannot do this in a document created from
the template.

Note that you can remove the references to Selection.Find in the
recorded macro; all you need is this:

Sub AutoNew()
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
Problem began with step 6 of your instructions.
1. I open template
2. Insert Bookmark, named it "macroLocate"
3. Saved the template [named it at same time]
4. Turned on Macro Record
5. Typed: "AutoNew"; Selected the document to be saved in. hit ok
6. typed Ctrl+g, selected name of bookmark;go to;ok
Stop recording macro.
The following may help you find what I did wrong. Been trying for
2hrs. : - (
Sub AutoNew()
'
' AutoNew Macro
' Macro recorded 1/28/2007 by Joan O'Callaghan
'
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub



--
Joan


:

Hi Joan:

1) Open the template you want to use.

2) Insert a bookmark at the place you want the cursor to go,
named
appropriately (e.g. "macroLocate"). It doesn't matter what the
name is so
long as you can remember it. But it's a good idea not to use a
name you
might want to use later for some other bookmark.

3) Save the template.

4) Turn on the Macro Recorder

5) Type "AutoNew" as the name of the Macro and make sure you
change the
"Save macro in" field to the name of your template. The macro
must be named
AutoNew spelled just like that or it will not operate correctly.

6) Hit Ctrl + g, choose the name of the bookmark, then hit OK.
You can't
record mouse or cursor movements, hence using Ctrl + g -- Go To --
And
choosing the name of the bookmark.

If you do this right, any time anyone creates a new document from
that
template, the cursor will go where you put the bookmark. The
AutoNew name
cause the macro to run each time a new document is created from
the
template.

You will need to look up Macro Recorder in the Help. This isn't
easy: you
may not get it right on the first attempt :-) Have a couple of
tries then
get back to us if you have difficulty.

Cheers

On 24/1/07 5:05 AM, in article
(e-mail address removed), "JoanOC"

I would still like to try. Would you please tell me how.
Thanks.

--

Please reply to the newsgroup to maintain the thread. Please do
not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst,
Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 
Are you trying to record these actions in a macro? In that case, you're
doomed to failure. You need to delete the logo and resave the template (that
is, deleting the logo does not need to be part of the action of any macro).
Then you need to insert the bookmark as described, then create the AutoNew
macro. When you create a new document based on the template, the insertion
point should be at the place where you inserted the bookmark.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

JoanOC said:
Doesn't work. The template I am working on is the Professional Memo.
Using the mouse I delete the cells containing the logo.
Then again using the mouse the click on the the insertion point at the tab
point after the word "To:" [I read someplace that you can't use mouse when
creating a macro, but I have not begun that process yet].
Could I be doing something wrong before I even start creating the macroLocate?
Frustrating.
I tried to view all the formating contained in the template, but couldn't
find any insertion/cursor point before the point where I want it.
Should I give up?

--
Joan


Stefan Blom said:
It seems as if you need to re-insert the bookmark in the correct
location. Place the insertion point at the desired location. On the
Insert menu, click Bookmark. Click the "macroLocate" name, and then
click Add. This moves the bookmark to the chosen location.

Note that you can display bookmarks in order to work with them more
easily: On the Tools menu, click Options. Click the View tab. Click to
check the "Bookmarks" option, and then click OK.

--
Stefan Blom
Microsoft Word MVP


in message
I did as you suggested.
It did get rid of unwanted toolbars that were appearing after I stopped
running the macro when I saved an opened the template.
Yes, I am working with a template.
Problem now: When I open the template the cursor precedes the word Memo.
How do I get rid of it?
*Memo
To: *bookmark
Thanks for your help.
Shall look forward to reply.

--
Joan


:

Did you make sure to insert the bookmark and create the macro in the
template (*.dot file)? You cannot do this in a document created from
the template.

Note that you can remove the references to Selection.Find in the
recorded macro; all you need is this:

Sub AutoNew()
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
Problem began with step 6 of your instructions.
1. I open template
2. Insert Bookmark, named it "macroLocate"
3. Saved the template [named it at same time]
4. Turned on Macro Record
5. Typed: "AutoNew"; Selected the document to be saved in. hit ok
6. typed Ctrl+g, selected name of bookmark;go to;ok
Stop recording macro.
The following may help you find what I did wrong. Been trying for
2hrs. : - (
Sub AutoNew()
'
' AutoNew Macro
' Macro recorded 1/28/2007 by Joan O'Callaghan
'
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub



--
Joan


:

Hi Joan:

1) Open the template you want to use.

2) Insert a bookmark at the place you want the cursor to go,
named
appropriately (e.g. "macroLocate"). It doesn't matter what the
name is so
long as you can remember it. But it's a good idea not to use a
name you
might want to use later for some other bookmark.

3) Save the template.

4) Turn on the Macro Recorder

5) Type "AutoNew" as the name of the Macro and make sure you
change the
"Save macro in" field to the name of your template. The macro
must be named
AutoNew spelled just like that or it will not operate correctly.

6) Hit Ctrl + g, choose the name of the bookmark, then hit OK.
You can't
record mouse or cursor movements, hence using Ctrl + g -- Go To --
And
choosing the name of the bookmark.

If you do this right, any time anyone creates a new document from
that
template, the cursor will go where you put the bookmark. The
AutoNew name
cause the macro to run each time a new document is created from
the
template.

You will need to look up Macro Recorder in the Help. This isn't
easy: you
may not get it right on the first attempt :-) Have a couple of
tries then
get back to us if you have difficulty.

Cheers

On 24/1/07 5:05 AM, in article
(e-mail address removed), "JoanOC"

I would still like to try. Would you please tell me how.
Thanks.

--

Please reply to the newsgroup to maintain the thread. Please do
not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst,
Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 
I did delte the logo before I created the bookmark [macroLocate]and then did
ctrl+g to create the macro[AddNew].
I viewed the bookmark so know it is there.
Somehow, there must be some formatting that has the cursor positioned at the
beginning of the line MEMO.
If I could get rid of that maybe what I want to do would work.
--
Joan


Suzanne S. Barnhill said:
Are you trying to record these actions in a macro? In that case, you're
doomed to failure. You need to delete the logo and resave the template (that
is, deleting the logo does not need to be part of the action of any macro).
Then you need to insert the bookmark as described, then create the AutoNew
macro. When you create a new document based on the template, the insertion
point should be at the place where you inserted the bookmark.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

JoanOC said:
Doesn't work. The template I am working on is the Professional Memo.
Using the mouse I delete the cells containing the logo.
Then again using the mouse the click on the the insertion point at the tab
point after the word "To:" [I read someplace that you can't use mouse when
creating a macro, but I have not begun that process yet].
Could I be doing something wrong before I even start creating the macroLocate?
Frustrating.
I tried to view all the formating contained in the template, but couldn't
find any insertion/cursor point before the point where I want it.
Should I give up?

--
Joan


Stefan Blom said:
It seems as if you need to re-insert the bookmark in the correct
location. Place the insertion point at the desired location. On the
Insert menu, click Bookmark. Click the "macroLocate" name, and then
click Add. This moves the bookmark to the chosen location.

Note that you can display bookmarks in order to work with them more
easily: On the Tools menu, click Options. Click the View tab. Click to
check the "Bookmarks" option, and then click OK.

--
Stefan Blom
Microsoft Word MVP


in message
I did as you suggested.
It did get rid of unwanted toolbars that were appearing after I
stopped
running the macro when I saved an opened the template.
Yes, I am working with a template.
Problem now: When I open the template the cursor precedes the word
Memo.
How do I get rid of it?
*Memo
To: *bookmark
Thanks for your help.
Shall look forward to reply.

--
Joan


:

Did you make sure to insert the bookmark and create the macro in
the
template (*.dot file)? You cannot do this in a document created
from
the template.

Note that you can remove the references to Selection.Find in the
recorded macro; all you need is this:

Sub AutoNew()
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
Problem began with step 6 of your instructions.
1. I open template
2. Insert Bookmark, named it "macroLocate"
3. Saved the template [named it at same time]
4. Turned on Macro Record
5. Typed: "AutoNew"; Selected the document to be saved in. hit
ok
6. typed Ctrl+g, selected name of bookmark;go to;ok
Stop recording macro.
The following may help you find what I did wrong. Been trying
for
2hrs. : - (
Sub AutoNew()
'
' AutoNew Macro
' Macro recorded 1/28/2007 by Joan O'Callaghan
'
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub



--
Joan


:

Hi Joan:

1) Open the template you want to use.

2) Insert a bookmark at the place you want the cursor to go,
named
appropriately (e.g. "macroLocate"). It doesn't matter what
the
name is so
long as you can remember it. But it's a good idea not to use
a
name you
might want to use later for some other bookmark.

3) Save the template.

4) Turn on the Macro Recorder

5) Type "AutoNew" as the name of the Macro and make sure you
change the
"Save macro in" field to the name of your template. The macro
must be named
AutoNew spelled just like that or it will not operate
correctly.

6) Hit Ctrl + g, choose the name of the bookmark, then hit
OK.
You can't
record mouse or cursor movements, hence using Ctrl + g -- Go
To --
And
choosing the name of the bookmark.

If you do this right, any time anyone creates a new document
from
that
template, the cursor will go where you put the bookmark. The
AutoNew name
cause the macro to run each time a new document is created
from
the
template.

You will need to look up Macro Recorder in the Help. This
isn't
easy: you
may not get it right on the first attempt :-) Have a couple
of
tries then
get back to us if you have difficulty.

Cheers

On 24/1/07 5:05 AM, in article
(e-mail address removed), "JoanOC"

I would still like to try. Would you please tell me how.
Thanks.

--

Please reply to the newsgroup to maintain the thread. Please
do
not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst,
Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 
Just paste the code in a module in the template (see
http://www.gmayor.com/installing_macro.htm), add the bookmark at the
correct location, and save the *.dot file.

This should suffice, unless there is something else that you want the
macro to do...

Another important thing: Make sure to save the template in the correct
location (the user templates folder) so that you can access it from
File | New.

--
Stefan Blom
Microsoft Word MVP


in message
I did delte the logo before I created the bookmark [macroLocate]and then did
ctrl+g to create the macro[AddNew].
I viewed the bookmark so know it is there.
Somehow, there must be some formatting that has the cursor positioned at the
beginning of the line MEMO.
If I could get rid of that maybe what I want to do would work.
--
Joan


Suzanne S. Barnhill said:
Are you trying to record these actions in a macro? In that case, you're
doomed to failure. You need to delete the logo and resave the template (that
is, deleting the logo does not need to be part of the action of any macro).
Then you need to insert the bookmark as described, then create the AutoNew
macro. When you create a new document based on the template, the insertion
point should be at the place where you inserted the bookmark.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

JoanOC said:
Doesn't work. The template I am working on is the Professional Memo.
Using the mouse I delete the cells containing the logo.
Then again using the mouse the click on the the insertion point at the tab
point after the word "To:" [I read someplace that you can't use
mouse
when
creating a macro, but I have not begun that process yet].
Could I be doing something wrong before I even start creating
the
macroLocate?
Frustrating.
I tried to view all the formating contained in the template, but couldn't
find any insertion/cursor point before the point where I want it.
Should I give up?

--
Joan


:

It seems as if you need to re-insert the bookmark in the correct
location. Place the insertion point at the desired location. On the
Insert menu, click Bookmark. Click the "macroLocate" name, and then
click Add. This moves the bookmark to the chosen location.

Note that you can display bookmarks in order to work with them more
easily: On the Tools menu, click Options. Click the View tab. Click to
check the "Bookmarks" option, and then click OK.

--
Stefan Blom
Microsoft Word MVP


in message
I did as you suggested.
It did get rid of unwanted toolbars that were appearing after I
stopped
running the macro when I saved an opened the template.
Yes, I am working with a template.
Problem now: When I open the template the cursor precedes the word
Memo.
How do I get rid of it?
*Memo
To: *bookmark
Thanks for your help.
Shall look forward to reply.

--
Joan


:

Did you make sure to insert the bookmark and create the macro in
the
template (*.dot file)? You cannot do this in a document created
from
the template.

Note that you can remove the references to Selection.Find in the
recorded macro; all you need is this:

Sub AutoNew()
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
End Sub

--
Stefan Blom
Microsoft Word MVP


in message
Problem began with step 6 of your instructions.
1. I open template
2. Insert Bookmark, named it "macroLocate"
3. Saved the template [named it at same time]
4. Turned on Macro Record
5. Typed: "AutoNew"; Selected the document to be saved in. hit
ok
6. typed Ctrl+g, selected name of bookmark;go to;ok
Stop recording macro.
The following may help you find what I did wrong. Been trying
for
2hrs. : - (
Sub AutoNew()
'
' AutoNew Macro
' Macro recorded 1/28/2007 by Joan O'Callaghan
'
Selection.GoTo What:=wdGoToBookmark, Name:="macroLocate"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
End Sub



--
Joan


:

Hi Joan:

1) Open the template you want to use.

2) Insert a bookmark at the place you want the cursor to go,
named
appropriately (e.g. "macroLocate"). It doesn't matter what
the
name is so
long as you can remember it. But it's a good idea not to use
a
name you
might want to use later for some other bookmark.

3) Save the template.

4) Turn on the Macro Recorder

5) Type "AutoNew" as the name of the Macro and make sure you
change the
"Save macro in" field to the name of your template. The macro
must be named
AutoNew spelled just like that or it will not operate
correctly.

6) Hit Ctrl + g, choose the name of the bookmark, then hit
OK.
You can't
record mouse or cursor movements, hence using Ctrl + g -- Go
To --
And
choosing the name of the bookmark.

If you do this right, any time anyone creates a new document
from
that
template, the cursor will go where you put the bookmark. The
AutoNew name
cause the macro to run each time a new document is created
from
the
template.

You will need to look up Macro Recorder in the Help. This
isn't
easy: you
may not get it right on the first attempt :-) Have a couple
of
tries then
get back to us if you have difficulty.

Cheers

On 24/1/07 5:05 AM, in article
(e-mail address removed), "JoanOC"

I would still like to try. Would you please tell me how.
Thanks.

--

Please reply to the newsgroup to maintain the thread. Please
do
not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst,
Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top