deselct text while recording macro

B

bob adler

Hi:

I am trying to convert the "embedded" endnotes in a
document to unembeddded endnotes in Word 2000; Windows
XP, Home ed. With the help of another newsgroup, I now
have a method.

I am now trying to record a macro to automate the steps.
However, after I select text to perform an operation on
it, I need to deselect it for the next operation but I
have been unable to deselect while recording.

Is there a way to deselect text while recording a macro?
Thank you.

Bob adler
 
P

Peter Hewett

Hi bob adler

Just pause and resume the macro recorder. But if you recording a macro, surely you want
it to record all steps.

HTH + Cheers - Peter
 
B

bob adler

Peter. Thanks. I would love to record all steps.
But...how do I do that?
To make it concrete, I am listing the steps below. The
first problem is in trying to perform and record step 11
after I've recorded step 10. The second is I don't know
how to do step 12 while recording.
Thanks, again.
bob adler


1. Open the Article to be edited.

2. Start from Normal View.

3. Go to View>Footnotes>Endnotes

4. Select all the endnotes (Ctrl+A)

5. Copy the endnotes.

6. Open a new document.

7. Paste the endnotes into the new document.
You will see that each endnote now has a superscript 1.

8. Select all the endnotes (Ctrl+A)

9. Make sure the Ruler on the View menu is checked.

10. Create a Hanging Indent of a quarter inch or so
(by clicking the bottom of the two triangles on the ruler
and dragging it to the right. That will leave the
superscript 1 (that we want to get rid of) out to the
left with nothing below it.

11. Deselect the text.

12. Now, hold down Alt and use the mouse to select
all the superscript 1s; go straight down 'til they are
all highlighted.

13. Hit delete.

14. Select all the endnotes (Crtl+A).

15. Go up to the hanging indent triangle and move it
back so that everything is lined up flush left.

16. With the text still highlighted, go to
Format>Bullets and Numbering and click the Numbered tab.

17. Select the numbering starting with 1. 2. 3. and
click OK.

18. Save and name the document.

-----Original Message-----
Hi bob adler

Just pause and resume the macro recorder. But if you
recording a macro, surely you want
 
D

Doug Robbins - Word MVP

The Macro recorder is very rarely the best way to do something.

The following does what you want if you run it when the document containing
the endnotes is the active document:

Dim Source As Document, Target As Document, aen As Endnote, i As Integer
Set Source = ActiveDocument
Set Target = Documents.Add
i = 1
For Each aen In Source.Endnotes
Target.Range.InsertAfter i & "." & vbTab & aen.Range & vbCr
i = i + 1
Next aen
Dialogs(wdDialogFileSaveAs).Show


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

If you also need to delete the endnote reference from the text of the
document, use

Dim Source As Document, Target As Document, aen As Endnote, i As Integer
Set Source = ActiveDocument
Set Target = Documents.Add
i = 1
For Each aen In Source.Endnotes
Target.Range.InsertAfter i & "." & vbTab & aen.Range & vbCr
i = i + 1
aen.Reference.Delete
Next aen
Dialogs(wdDialogFileSaveAs).Show


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
B

bob adler

Mr. Robbins:
The Search function for the newsgroup has not been
working; I can't find my original thread for this issue.
A different newsgroup thread resulted in your posting the
following macro to unembed endnotes and to change the
number preceding each endnote from superscript to regular
font:

Dim aendnote As Endnote
For Each aendnote In ActiveDocument.Endnotes
ActiveDocument.Range.InsertAfter vbCr &
aendnote.Index & ". " & aendnote.Range
aendnote.Reference.InsertBefore "a" &
aendnote.Index & "a"
Next aendnote
For Each aendnote In ActiveDocument.Endnotes
aendnote.Reference.Delete
Next aendnote
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Superscript = True
End With
With Selection.Find
.Text = "(a)([0-9]{1,})(a)"
.Replacement.Text = "\2"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

I overlooked an unintended result ot the macro: It is not
only removing the superscript format from the number
preceding the endnote, it is removing all the formatting
from the endnotes themselves. Our endnotes contain
necessary italics and other formatting, and it all
disappears when I run the macro. Can the macro be
modified to remove just the superscript formatting of the
number preceding each endnote while leaving the formating
in the endnote itself?
Thank you, again.
Bob Adler
 

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

Top