Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 01-09-2024, 05:08 PM
Guessed's Avatar
Guessed Guessed is offline Macro required Windows 10 Macro required Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,187
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

Yes, it does sound like a job for a macro but there likely would need to be more than one macro.

Say for example, clicking on something runs a macro and the target content gets highlighted in Bold before the macro ends. Then the user moves the selection point - but the bolded text would remain bolded because there isn't a command to change it back as the selection moves away.

Perhaps the de-selecting could happen automatically if the target area was defined with a Content Control as well as a bookmark. Then an OnExit macro could be implemented. For instance, if you place Rich Text Content Controls around some text, you can put these macros in your ThisDocument module.
Code:
Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl)
  ContentControl.Range.Font.Bold = True
  ContentControl.Color = wdColorAqua
End Sub

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
  ContentControl.Range.Font.Reset
  ContentControl.Color = wdColorWhite
End Sub
The bookmark shouldn't define the entire text in the ContentControl, just be contained somewhere inside it.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
documents print setup defined in page setup, but overriden by printer settings. macro required? Rosemary Word VBA 6 02-18-2021 11:10 PM
Macro required Help with some VBA code Required dmcg9760 Excel Programming 9 03-01-2016 03:59 PM
Excel 2007 - formula or macro/vba code required wrighty50 Excel Programming 3 05-13-2012 02:24 PM
Macro or routine required evanhughes Outlook 0 11-18-2011 02:56 AM
Suggestion required domex Word 0 10-06-2010 05:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:05 AM.


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