Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 03-03-2013, 12:46 AM
macropod's Avatar
macropod macropod is offline Rich Text Content Controls: Formatting? Windows 7 64bit Rich Text Content Controls: Formatting? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,520
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

I'd suggest using a character Style rather than a paragraph Style, as it means you can use this Style in paragraphs that are otherwise formatted differently.

Here's how you can apply it to all Rich Text content controls:
Code:
Sub Demo()
Dim oStyle As Style, oControl As ContentControl
Set oStyle = ActiveDocument.Styles.Add("RTCCStyle", wdStyleTypeCharacter)
With oStyle
    .QuickStyle = True
    .Font.Underline = wdUnderlineThick
    .Font.UnderlineColor = wdColorBlack
    .Font.Italic = True
    .Font.ColorIndex = wdRed
End With
For Each oControl In ActiveDocument.ContentControls
  If oControl.Type = wdContentControlRichText Then
    oControl.Range.Style =  = oStyle.NameLocal
  End If
Next oControl
End Sub
If you only want to apply it to some Rich Text content controls, you'll need additional rules you can test with If statements. For example, any one or more of the Section of the document, the Rich Text content control's title, a bookmarked range could be used.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 03-03-2013 at 12:49 AM. Reason: Minor code enhancement
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rich Text Content Controls: Formatting? Rich text/Plain text Content Controls in Template michael.fisher5 Word 9 11-19-2014 06:36 AM
Rich Text Content Controls: Formatting? How do you set rich text in a content control Testor Word VBA 4 07-08-2012 07:55 AM
Rich Text Content Controls: Formatting? Rich Text Content Control - Allow User Formatting keithacochrane Word 1 05-28-2012 05:06 PM
Rich Text Content Controls: Formatting? Grouping Content Controls cksm4 Word VBA 2 03-01-2011 12:46 PM
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM

Other Forums: Access Forums

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