We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
Change text from lower to uppercase in word FIXED
Comments
-
I'm not impressed with Google on this. I don't really understand how it can give an answer it claims is correct, but then knows it's not correct when you go back and query it. And to do it twice.
I ran the code through a VBA-specific checker, and it changed it to this:-
Sub ConvertTextAfterQuoteToUppercase()
Dim rng As Range
Set rng = ActiveDocument.Content
With rng.Find
.ClearFormatting
' Finds an opening quote followed by any lowercase letter
' [""'‘“] covers straight and curly, single and double quotes
.Text = "([""''‘“])([a-z])"
.MatchWildcards = True
.Forward = True
.Wrap = wdFindStop
' Loop through all matches in the document
Do While .Execute
' The matched range (rng) encompasses both characters.
' The second captured group ([a-z]) is the second character.
rng.Characters(2).Text = UCase(rng.Characters(2).Text)
' Collapse range to move past the current match and continue searching
rng.Collapse wdCollapseEnd
Loop
End With
MsgBox "Finished converting text after quotation marks to uppercase.", vbInformation
End Sub1 -
Thank you I will try that over the weekend
0 -
Thank you so much for your help it worked.
1 -
That is because LLM AI does not know anything. They are basically very fancy predictive text engines.
1 -
It didn't predict very well. Maybe the errors in question are a consequence of older versions of the development environment or something? That's a very human error - creating a non-working program due to "remembering" the object model wrongly.
I didn't go down the rabbit hole of asking it to syntax check its own code, but presumably there's some nugget of learning there for it to do that itself (when producing code) rather than waiting to be prompted.
1
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 355.7K Banking & Borrowing
- 254.9K Reduce Debt & Boost Income
- 456.1K Spending & Discounts
- 248.3K Work, Benefits & Business
- 605.9K Mortgages, Homes & Bills
- 179K Life & Family
- 263.7K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.2K Discuss & Feedback
- 37.7K Read-Only Boards
