Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 09-12-2023, 01:15 AM
profitbookie profitbookie is offline Batch change the font style in multiple word files inside folder and subfolders Windows 11 Batch change the font style in multiple word files inside folder and subfolders Office 2016
Novice
 
Join Date: Sep 2023
Posts: 4
profitbookie is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
The following macro run as a custom process from Document Batch Processes to handle the folders (and subfolders) will change the fonts as required. Do however test it with one document on screen first to establish that it does what you require.

Code:
Function ChangeFont(oDoc As Document) As Boolean
Dim oStory As Range
    On Error GoTo err_Handler
    For Each oStory In oDoc.StoryRanges
        oStory.Font.Name = "Trebucket MS"
        If oStory.StoryType <> wdMainTextStory Then
            While Not (oStory.NextStoryRange Is Nothing)
                Set oStory = oStory.NextStoryRange
                oStory.Font.Name = "Trebucket MS"
            Wend
        End If
    Next oStory
    Set oStory = Nothing
    ChangeFont = True
lbl_Exit:
    Exit Function
err_Handler:
    ChangeFont = False
    Resume lbl_Exit
End Function


Hello Sir, Can you please give me the code if I just have to change the font size. Like I have 220 word documents and I just have the change the font size from 14 to 8 in all of them. Just the code & command for font size change.

Thank you in advance sir
Reply With Quote
 

Tags
font change, font style



Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch Comparing Multiple Word Files scienceguy Word VBA 2 10-27-2021 07:43 AM
Batch change the font style in multiple word files inside folder and subfolders List all word files in folder and subfolders eduzs Word VBA 5 06-09-2019 06:20 AM
Macro to change/convert/delete txt files in folder+subfolders NoS Word VBA 4 03-03-2016 12:10 PM
Batch change the font style in multiple word files inside folder and subfolders Batch add suffix to PDF files in folder Dave T Windows 2 03-01-2016 08:07 PM
Batch change the font style in multiple word files inside folder and subfolders Change font style and size in multiple documents fitkhan Word 1 04-27-2011 09:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:40 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