Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2022, 11:02 AM
Abbas Abbas is offline Automate formatting Windows 10 Automate formatting Office 2016
Novice
Automate formatting
 
Join Date: Jan 2022
Posts: 9
Abbas is on a distinguished road
Default Automate formatting


Hi,
I want to format every "course" like what's shown in the picture or the document below
Attached Images
File Type: png Untitled.png (31.1 KB, 21 views)
Attached Files
File Type: docx AutomateStyle.docx (13.2 KB, 7 views)
Reply With Quote
  #2  
Old 06-26-2022, 06:06 PM
Guessed's Avatar
Guessed Guessed is offline Automate formatting Windows 10 Automate formatting Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You can do this with a regular search and replace. Recording this as a macro would end up something similar to this
Code:
Sub HiLiteCourses()
  Options.DefaultHighlightColorIndex = wdYellow
  With Selection.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Replacement.Highlight = True
    .Replacement.Font.Color = wdColorRed
    .Text = "course"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = True
    .Execute Replace:=wdReplaceAll
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to automate changes to slide Mearsy PowerPoint 0 08-18-2015 03:29 AM
Automate formatting Automate document properties Ted C Word VBA 11 08-04-2014 06:31 AM
Automate Office Attendance kgwack Outlook 0 02-14-2012 09:39 AM
How to automate all slides Pemberton PowerPoint 1 11-09-2011 04:39 PM
Automate formatting Can I automate or make a macro for this? mkoenig Word VBA 1 01-31-2010 02:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:46 PM.


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