Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
I need to find a way to format text that contains both superscript and normal
characters. I am trying to find a way to do a find/replace command that accomplishes the following: [superscript numbers]. to .[superscript numbers] The numbers in question are reference citations, so I can't just type in the actual numbers; I need something that will grab all superscript numbers and treat them as a single unit that I can move the period around. Doesn't seem like it would be this difficult, but I can't find a way to do it. Thanks! |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
On Thu, 8 Nov 2007 07:37:04 -0800, GMatiasevich
wrote: I need to find a way to format text that contains both superscript and normal characters. I am trying to find a way to do a find/replace command that accomplishes the following: [superscript numbers]. to .[superscript numbers] The numbers in question are reference citations, so I can't just type in the actual numbers; I need something that will grab all superscript numbers and treat them as a single unit that I can move the period around. Doesn't seem like it would be this difficult, but I can't find a way to do it. Thanks! If these superscript numbers are the only numbers in the document that are immediately followed by a period, then you can do it with a wildcard replacement (http://www.gmayor.com/replace_using_wildcards.htm). In the Replace dialog, click the More button and check the box for "Use wildcards". Then enter this expression in the Find What box: ([0-9]{1,})(.) and enter this one in the Replace With box: \2\1 Then click the Replace All button. The possible problem is that there's no way (except with a somewhat complicated macro) to make the replacement work only on superscript numbers, because the search box has no way to specify formatting for only part of the expression. If there are non-superscript numbers followed by a period -- for example, a date at the end of a sentence -- you could manually click the Replace and Find Next buttons to guide the replacement, or you can post back for help with the macro. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#3
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
It might help to note that you can replace with formatted strings that are
first copied to the clipboard. This might give you more flexibility by replacing your search string with ^c -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jay Freedman wrote: On Thu, 8 Nov 2007 07:37:04 -0800, GMatiasevich wrote: I need to find a way to format text that contains both superscript and normal characters. I am trying to find a way to do a find/replace command that accomplishes the following: [superscript numbers]. to .[superscript numbers] The numbers in question are reference citations, so I can't just type in the actual numbers; I need something that will grab all superscript numbers and treat them as a single unit that I can move the period around. Doesn't seem like it would be this difficult, but I can't find a way to do it. Thanks! If these superscript numbers are the only numbers in the document that are immediately followed by a period, then you can do it with a wildcard replacement (http://www.gmayor.com/replace_using_wildcards.htm). In the Replace dialog, click the More button and check the box for "Use wildcards". Then enter this expression in the Find What box: ([0-9]{1,})(.) and enter this one in the Replace With box: \2\1 Then click the Replace All button. The possible problem is that there's no way (except with a somewhat complicated macro) to make the replacement work only on superscript numbers, because the search box has no way to specify formatting for only part of the expression. If there are non-superscript numbers followed by a period -- for example, a date at the end of a sentence -- you could manually click the Replace and Find Next buttons to guide the replacement, or you can post back for help with the macro. |
#4
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Replacement with a formatted string in the clipboard is fine, but you
can't _search_ for a string with mixed formatting except with a macro that examines the found range. On Fri, 9 Nov 2007 08:18:14 +0200, "Graham Mayor" wrote: It might help to note that you can replace with formatted strings that are first copied to the clipboard. This might give you more flexibility by replacing your search string with ^c -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jay Freedman wrote: On Thu, 8 Nov 2007 07:37:04 -0800, GMatiasevich wrote: I need to find a way to format text that contains both superscript and normal characters. I am trying to find a way to do a find/replace command that accomplishes the following: [superscript numbers]. to .[superscript numbers] The numbers in question are reference citations, so I can't just type in the actual numbers; I need something that will grab all superscript numbers and treat them as a single unit that I can move the period around. Doesn't seem like it would be this difficult, but I can't find a way to do it. Thanks! If these superscript numbers are the only numbers in the document that are immediately followed by a period, then you can do it with a wildcard replacement (http://www.gmayor.com/replace_using_wildcards.htm). In the Replace dialog, click the More button and check the box for "Use wildcards". Then enter this expression in the Find What box: ([0-9]{1,})(.) and enter this one in the Replace With box: \2\1 Then click the Replace All button. The possible problem is that there's no way (except with a somewhat complicated macro) to make the replacement work only on superscript numbers, because the search box has no way to specify formatting for only part of the expression. If there are non-superscript numbers followed by a period -- for example, a date at the end of a sentence -- you could manually click the Replace and Find Next buttons to guide the replacement, or you can post back for help with the macro. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#5
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
True - but depending on what is being sought, it may be possible to find the
search string regardless of its formatting. This is essentially what you suggested with ([0-9]{1,})(.) which I suspect would have filled the bill for the OP. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jay Freedman wrote: Replacement with a formatted string in the clipboard is fine, but you can't _search_ for a string with mixed formatting except with a macro that examines the found range. On Fri, 9 Nov 2007 08:18:14 +0200, "Graham Mayor" wrote: It might help to note that you can replace with formatted strings that are first copied to the clipboard. This might give you more flexibility by replacing your search string with ^c -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jay Freedman wrote: On Thu, 8 Nov 2007 07:37:04 -0800, GMatiasevich wrote: I need to find a way to format text that contains both superscript and normal characters. I am trying to find a way to do a find/replace command that accomplishes the following: [superscript numbers]. to .[superscript numbers] The numbers in question are reference citations, so I can't just type in the actual numbers; I need something that will grab all superscript numbers and treat them as a single unit that I can move the period around. Doesn't seem like it would be this difficult, but I can't find a way to do it. Thanks! If these superscript numbers are the only numbers in the document that are immediately followed by a period, then you can do it with a wildcard replacement (http://www.gmayor.com/replace_using_wildcards.htm). In the Replace dialog, click the More button and check the box for "Use wildcards". Then enter this expression in the Find What box: ([0-9]{1,})(.) and enter this one in the Replace With box: \2\1 Then click the Replace All button. The possible problem is that there's no way (except with a somewhat complicated macro) to make the replacement work only on superscript numbers, because the search box has no way to specify formatting for only part of the expression. If there are non-superscript numbers followed by a period -- for example, a date at the end of a sentence -- you could manually click the Replace and Find Next buttons to guide the replacement, or you can post back for help with the macro. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find & Replace does not find formatting | Microsoft Word Help | |||
Find/Replace formatting | Microsoft Word Help | |||
Find & Replace &vba: formatting, like bold | Microsoft Word Help | |||
Find & Replace does not find formatting | Microsoft Word Help | |||
How do I find and replace a superscript number in a word? | Microsoft Word Help |