View Single Post
 
Old 06-14-2023, 12:00 PM
Jamez Jamez is offline Windows 10 Office 2019
Novice
 
Join Date: Jun 2023
Posts: 3
Jamez is on a distinguished road
Default

I've tried ChatGPT to get a macro to do this but I always get an error.

This is what ChatGPT came up with, but I receive Compile error: Method or data member not found


Sub ApplyDropCapOptions()
Dim rng As Range
Dim dropCap As DropCap

' Loop through each paragraph in the document
For Each rng In ActiveDocument.Paragraphs.Range
' Check if the paragraph has a drop cap
If rng.DropCap = True Then
' Select the drop cap
rng.Select

' Open the Drop Cap Options dialog box
Set dropCap = Selection.ParagraphFormat.DropCap
dropCap.Clear

' Click "OK" to apply default settings
dropCap.Enable = True
dropCap.Position = wdDropNormal
dropCap.LinesToDrop = 1

' Close the Drop Cap Options dialog box
dropCap.Clear
End If
Next rng
End Sub
Reply With Quote