Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2012, 11:25 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
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

Hi frondeur,



You can't make this something that automatically occurs in the background as part of the captioning. Try:
Code:
Sub CaptionBold()
Application.ScreenUpdating = False
Dim RngCap As Range
With ActiveDocument
  On Error Resume Next
  .Styles.Add "CaptionLabel", wdStyleTypeCharacter
  On Error GoTo 0
  .Styles("CaptionLabel").Font.Bold = True
  .Styles("Caption").Font.Bold = False
  With .Range
    With .Find
      .ClearFormatting
      .Text = ""
      .Style = "Caption"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindStop
      .Format = True
      .Execute
    End With
    Do While .Find.Found
      Set RngCap = .Paragraphs.Last.Range.Duplicate
      With RngCap
        .End = .Start + Len(Split(.Text, " ")(0)) + 1
        .MoveEndUntil " ", wdForward
        .Style = "CaptionLabel"
      End With
      .Collapse wdCollapseEnd
      .Find.Execute
    Loop
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 06-14-2012, 10:09 PM
treflip treflip is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Jun 2012
Posts: 5
treflip is on a distinguished road
Default Please explain how to modify styles and add macro

Hello, I am needing the same style for my figures and tables. I am new to styles and macros though. Can you please explain how to set up the styles and macro to enable this option? Thank you.


I am hoping by using this style and macro I can have my captions automatically have a bold label and normal description.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Matching text style to drawing object style notarichman PowerPoint 0 03-07-2011 11:34 AM
One line of text - two formats? judicial85 Word 4 02-18-2011 04:24 AM
Formatting of TOC's generated based on the "Caption" style JustinWord1000 Word 1 02-15-2011 03:13 PM
unwanted text in a label J J J J Word 0 11-22-2010 11:04 AM
Custom caption label annoyance zac Word 1 08-29-2010 09:56 AM

Other Forums: Access Forums

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