Can IT do Something Similar to my Macro?

Posted by ambeck22 ® , 03/26/2022, 09:04:59 Reply   Forum

I have a favorite custom macro an awesome guy made for me that changes a comma to a period and vice versa for the immediate punctuation that is to the left of the cursor. Fluency does not use Word, therefore I cannot use my macro with Fluency. Can I make IT do something similar? I'll paste the macro below. I'm pretty sure it's wishful thinking at this point and will just have to adjust. If anyone uses Fluency and has some favorite IT commands/entries they would like to share, it would be much appreciated!

-------------------------------------------

Sub PeriodComma2()
'macro by Ed Weber Copyright (c) 2009 all rights reserved
'The macro will search backwards to the first comma or period it finds then
' will be replaced with
' will be replaced with
'It is the user's responsibility to be aware of a period in an abbreviation or decimal number
'or of a comma in number or a date.
Dim rng As Range
Set rng = Selection.Range.Duplicate
rng.Collapse
With rng.Find
.ClearFormatting
.MatchWildcards = True
.Text = "[,.]"
.Forward = False
.Execute
End With
If rng.Find.Found Then
With rng
.End = .End + 1
Do Until Right(.Text, 1) <> "," And Right(.Text, 1) <> "." And Right(.Text, 1) <> " "
.End = .End + 1
Loop
If Left(.Text, 1) = "," Then
.Case = wdUpperCase
.End = .End - 1
.Delete
.InsertAfter ". "
ElseIf Left(.Text, 1) = "." Then
.Case = wdLowerCase
.End = .End - 1
.Delete
.InsertAfter ", "
End If
End With
Else
MsgBox "No comma or period found to the left of the cursor"
End If
End Sub




Edit | Reply | | View All | |   | Current page | Author
Followups