Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2019, 08:47 PM
jwall jwall is offline How to write a macro for bolding text between quotes Windows 10 How to write a macro for bolding text between quotes Office 2019
Novice
How to write a macro for bolding text between quotes
 
Join Date: Dec 2019
Posts: 2
jwall is on a distinguished road
Default How to write a macro for bolding text between quotes

Hi,





In Word 2016, I would like to create two different macros and have no idea how that could be done. This would save me many hours of work.



1. The first will bold all text found between two quotation marks. For example "this is the text I want to bold"



2. A second macro that would set all type between to 2 brackets to a Times New Roman size 12 font. Example: (Text here to size 12)



I have many documents to format each with 100's of these types of changes.



Any help would be appreciated.
JJ
Reply With Quote
  #2  
Old 12-09-2019, 09:34 PM
macropod's Avatar
macropod macropod is offline How to write a macro for bolding text between quotes Windows 7 64bit How to write a macro for bolding text between quotes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You don't need a macro to do any of that on a single document. In fact, it can all be done with two wildcard Find/Replace actions, where:
Find = ["“]*["”]
Replace = ^&
and you set the replacement font attributes to bold, and
Find = \(*\)
Replace = ^&
and you set the replacement font attributes to Times New Roman size 12. The macro recorder will record the essential details and, for a macro to do a Find/Replace on all documents in a selected folder, see: https://www.msofficeforums.com/134542-post2.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-09-2019, 09:53 PM
jwall jwall is offline How to write a macro for bolding text between quotes Windows 10 How to write a macro for bolding text between quotes Office 2019
Novice
How to write a macro for bolding text between quotes
 
Join Date: Dec 2019
Posts: 2
jwall is on a distinguished road
Default thanks

Thanks, I will try to record a macro with this...

One more question, I noticed now that some words in brackets are in uppercase letters. eg. (WORD) how can I make all letters or words in brackets to default back to lower case?

Thanks so much for the above macros. You saved me many hours of work.
Reply With Quote
  #4  
Old 12-09-2019, 10:04 PM
macropod's Avatar
macropod macropod is offline How to write a macro for bolding text between quotes Windows 7 64bit How to write a macro for bolding text between quotes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by jwall View Post
I noticed now that some words in brackets are in uppercase letters. eg. (WORD) how can I make all letters or words in brackets to default back to lower case?
That requires a rather more complicated macro to loop though each of the found ranges and change their case. Such a macro appears in: https://www.msofficeforums.com/141361-post2.html. The code there can be integrated into the code in the previous link I posted.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
macro, type 1 fonts

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write a macro for bolding text between quotes Macro to write bold and unformatted text in a single cell Snoorelax Word VBA 2 06-27-2018 06:24 PM
How to write a macro for bolding text between quotes How to replace straight quotes with smart quotes in existing document PABwriter Word 4 05-27-2016 03:36 PM
Creating macro in 2007 to bold within quotes on the fly marymaryt Word VBA 5 06-01-2015 06:55 AM
Bolding in script ksigcajun Word VBA 10 02-23-2015 08:29 AM
How to write a macro for bolding text between quotes macro to format selected text with curly quotes ysostarman Word VBA 10 11-11-2014 12:51 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:19 AM.


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