Re: VB code to separate names and put each on a separate line.



1. To put a (single) quotation mark inside quotes, just double it up ...

.Execute FindText:="."" ", ReplaceWith:="."" "

2. This is rather more interesting. To search for a footnote mark use ^f; when you find it you don't know the actual number so you must have it replaced with what it found (plus the extra space) - the replace code for 'what I found' is ^&. So it would appear that you want to search for ^f(space) and replace it with ^&(space). There are two issues with this.

The first you should be aware of but probably won't cause you a problem. If you do this via the UI Dialog it will change the footnote itself as well as the reference in the document body. If you do it in VBA it will only change the reference.

The second is that you end up with a rather odd formatting effect of the added space being in the format of the footnote reference rather than the following space (assuming they are different) - generally this gives you the extra space in superscript and thus slightly smaller than you would expect it to be. You can code round this if it is a problem but it does involve a little messing about as you have to insert the space yourself rather than using the Replace functionality of the Find&Replace.

--
Enjoy,
Tony

"StargateFan" <IDon'tAcceptSpam@IDon'tAcceptSpam.com> schreef in bericht news:q3g4035uiseb7560o46t6gft13nfsucukc@xxxxxxxxxx
On Thu, 8 Mar 2007 18:09:09 -0000, "Tony Jollans" <My forename at my
surname dot com> wrote:


With ActiveDocument.Range.Find
.Execute FindText:="^l", ReplaceWith:=" ", Replace:=wdReplaceAll
.Execute FindText:="^p", ReplaceWith:=" ", Replace:=wdReplaceAll
.Execute FindText:="^w", ReplaceWith:=" ", Replace:=wdReplaceAll
.Execute FindText:=" ", ReplaceWith:="^p", Replace:=wdReplaceAll
End With

... If you have one or more spaces at the beginning of the document you will
get a single blank line at the beginning - and similarly at the end. This
can be dealt with but it's not worth it unless you're likely to need it.
Otherwise it will catch most things.

--
Enjoy,
Tony

Hi!

1) I found that if I added things, it would make this more
comprehensive. But I ran into a problem with quotation marks. What
if you need to replace
." (one space after)
to
." (two spaces after)

This below doesn't work because of course, the quotation mark is used
in the macro to denote the end of the search term:

.Execute FindText:="." ", ReplaceWith:="." ",
Replace:=wdReplaceAll

Is there any way around this?

2) Also, there is another type of text formatting change I sometimes
need to make. It's to correct spacing after sentences with a
reference on the end to footnote, like this:

"... May of 1999.[4] (followed by 1 space)"

need to put two spaces after the "]" so that it looks like this:
"... May of 1999.[4] (2 spaces)"

These attempts don't work <g>:
.Execute FindText:=".[@] ", ReplaceWith:=".[@] ",
Replace:=wdReplaceAll

.Execute FindText:=".[?] ", ReplaceWith:=".[?] ",
Replace:=wdReplaceAll



So just those 2 things:

1) what to use in place of " to search for ."

2) how to replace a changing type of text as in the numbers in this
case (for all those legal docts.). The put 2 spaces after these
types of text entries:

.[3], .[24], .[159]

Thanks. :oD


.



Relevant Pages

  • Re: Footnote Number Fonts
    ... I indicated, the Footnote ... Reference style does indeed appear in the "Formatting of Selected Text" box. ... > change the font or font size as desired. ...
    (microsoft.public.word.docmanagement)
  • Re: Footnote formatting problem
    ... Are the reference numbers in the text formatted in Footnote Reference style? ... the formatting toolbar has a dropdown menu that changes ... See these links re WordPerfect vs. ...
    (microsoft.public.word.docmanagement)
  • Re: Footnote formatting problem
    ... Are the reference numbers in the text formatted in Footnote Reference style? ... the formatting toolbar has a dropdown menu that changes ... See these links re WordPerfect vs. ...
    (microsoft.public.word.docmanagement)
  • Re: Style Templates [was: Master Sub Documents (Thesis writing with Word)]
    ... footnotes use the Footnote Text paragraph style (which you can ... the footnote) use the Footnote Reference character style, ... use footnote text formatting. ... footnote text assumes the format of that in the reference file (i.e., ...
    (microsoft.public.word.formatting.longdocs)
  • Re: Changing all endnotes numbers from Roman to Latin
    ... in the style "Endnote reference" which is correct; ... Superscript, Not Double strikethrough". ... I've always gotten a space between the footnote ...
    (microsoft.public.word.newusers)