Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Peter T. Daniels Peter T. Daniels is offline
external usenet poster
 
Posts: 3,215
Default Wildcard "special" searches

(Word2007)

My authors are European, so they love to put their periods and commas
after their footnote references, but that's not how we Americans do
it. I'm getting tired of manually moving the punctuation around (and
the Transpose macro results in a superscript period before the
footnote reference, which isn't an improvement).

Word tells me that I cannot use both ^f and Wildcards in a
(Find-)Replace, so how can I automate this procedure? (Is it possible
to modify the Transpose macro to not affect the Superscript status of
the characters involved, since it's unlikely in the extreme that a
typo would involve superscripting!)

(Here's the text of the macro that was provided here years ago; it was
modified from the original because it was taking longer and longer to
work as a file got bigger, so a checking operation was removed.)

Sub Transpose()
Dim oRng As Range
Dim sText As String
Dim Msg1 As String
Dim Msg2 As String
Dim Msg3 As String
Dim MsgTitle As String
Msg1 = "You must place the cursor between " & _
"the 2 characters to be transposed!"
Msg2 = "There are no characters to transpose?"
Msg3 = "There is no document open!"
MsgTitle = "Transpose Characters"
On Error GoTo ErrorHandler
Set oRng = Selection.Range
Select Case Len(oRng)
Case Is = 0
If oRng.Start = oRng.Paragraphs(1).Range.Start Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End If
With oRng
.Start = .Start - 1
.End = .End + 1
.Select
sText = .Text
End With
Case Is = 1
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
Case Is = 2
sText = Selection.Range.Text
Case Else
MsgBox Msg1, vbCritical, MsgTitle
Exit Sub
End Select
With Selection
If .Range.Characters(1).Case = 1 _
And .Range.Characters(2).Case = 0 Then
.TypeText UCase(Mid(sText, 2, 1)) & _
LCase(Mid(sText, 1, 1))
Else
.TypeText Mid(sText, 2, 1) & _
Mid(sText, 1, 1)
End If
.MoveLeft wdCharacter
End With
End
ErrorHandler:
If Err.Number = 4248 Then
MsgBox Msg3, vbCritical, MsgTitle
End If
End Sub
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Logical OR in Word wildcard searches wildetudor Microsoft Word Help 2 March 17th 09 02:13 AM
In "Paste Special", Can I set "Unformatted Text" as the first choi ATMYTV Microsoft Word Help 1 April 24th 08 06:07 AM
How to default to "Unformatted Text" in "Paste Special" in Word 20 Lucky Green Microsoft Word Help 3 October 4th 06 06:52 AM
Wildcard file searches PA New Users 1 July 12th 06 01:09 PM
specific searches in word documents, ie "Trust C" cware Microsoft Word Help 2 March 23rd 06 03:39 PM


All times are GMT +1. The time now is 09:09 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"