Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2023, 02:05 PM
gmaxey gmaxey is offline Automatically update Drop Caps? Windows 10 Automatically update Drop Caps? Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ApplyDropCapOptions()
'To clear all
Dim lngPar As Long
Dim oPar As Paragraph
Dim dropCap As dropCap
  For lngPar = ActiveDocument.Paragraphs.Count To 1 Step -1
    Set oPar = ActiveDocument.Paragraphs(lngPar)
    If Len(oPar.Range.Text) > 1 Then
      With oPar.dropCap
        If .Position <> wdDropNone Then
          .Clear
        End If
      End With
    End If
  Next lngPar
End Sub

Sub ApplyDropCapOptionsII()
'To set all applied drop caps to 2
Dim lngPar As Long
Dim oPar As Paragraph
Dim dropCap As dropCap
  For lngPar = ActiveDocument.Paragraphs.Count To 1 Step -1
    Set oPar = ActiveDocument.Paragraphs(lngPar)
    If Len(oPar.Range.Text) > 1 Then
      With oPar.dropCap
        If .Position <> wdDropNone Then
          .LinesToDrop = 2
        End If
      End With
    End If
  Next lngPar
End Sub

__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #2  
Old 06-14-2023, 03:42 PM
Jamez Jamez is offline Automatically update Drop Caps? Windows 10 Automatically update Drop Caps? Office 2019
Novice
Automatically update Drop Caps?
 
Join Date: Jun 2023
Posts: 3
Jamez is on a distinguished road
Default

Thank you gmaxey, I don't see any change in the drop caps after running this. I also get an error at the end: Run-time error '4605': This method or property is not available because the current paragraph has no text.

Is there a special way I am supposed to run this macro?

The first macro is supposed to clear all drop caps and the second macro is supposed to set all drop caps to 2 lines, is that correct?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to convert first word of each section to Drop Caps wrdy Word VBA 2 05-30-2023 01:20 PM
Powerpoint-2019 Text in selected theme remains in All Caps even when small caps option is selected Tanasha4 PowerPoint 2 04-06-2019 07:53 PM
Automatically update Drop Caps? Need a Macro to Change Every Instance of Small Caps to All Caps and Reduce the Font by 2 Points CrossReach Word VBA 2 11-13-2017 09:21 AM
Automatically update Drop Caps? Drop Caps Problem dustnik Word 5 12-12-2016 01:14 PM
Multiple drop caps Ziggy-R Publisher 0 10-26-2010 06:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft