Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2016, 09:02 AM
jeffreybrown jeffreybrown is offline Bold a sentence containing an em dash Windows Vista Bold a sentence containing an em dash Office 2007
Expert
Bold a sentence containing an em dash
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default Bold a sentence containing an em dash


I have a doc with sentences containing an em dash in the middle.

How can I get all those sentences as bold?

Examples:
The Purpose and Method of Luke’s Gospel—Read Luke 1:1-4
Zacharias Ministers in the Temple—Read Luke 1:5-10
Reply With Quote
  #2  
Old 09-03-2016, 11:35 PM
macropod's Avatar
macropod macropod is offline Bold a sentence containing an em dash Windows 7 64bit Bold a sentence containing an em dash Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,371
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

Unless your text spans an entire paragraph or an entire line delineated with manual line breaks, what you're asking for isn't possible. That's because Word has no Find/Replace tools for finding grammatical sentences. The same limitation applies to VBA.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-04-2016, 06:15 AM
jeffreybrown jeffreybrown is offline Bold a sentence containing an em dash Windows Vista Bold a sentence containing an em dash Office 2007
Expert
Bold a sentence containing an em dash
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Hi Paul,

Yes, the text spans an entire paragraph and there is a manual line break at the end.
Reply With Quote
  #4  
Old 09-07-2016, 07:26 PM
macropod's Avatar
macropod macropod is offline Bold a sentence containing an em dash Windows 7 64bit Bold a sentence containing an em dash Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,371
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

Please clarify - paragraph breaks and manual line breaks are entirely different things.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 09-07-2016, 08:05 PM
jeffreybrown jeffreybrown is offline Bold a sentence containing an em dash Windows Vista Bold a sentence containing an em dash Office 2007
Expert
Bold a sentence containing an em dash
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

The document is downloaded from the internet with manual line breaks (arrow pointing to the left), but I can easily change them to paragraph breaks if it's easier to perform the bold
Reply With Quote
  #6  
Old 09-08-2016, 03:53 AM
macropod's Avatar
macropod macropod is offline Bold a sentence containing an em dash Windows 7 64bit Bold a sentence containing an em dash Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,371
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

Try a wildcard Find/Replace, where:
Find = [!^13^11]@^0151[!^13^11]@[^13^11]
Replace = ^&
and you specify the replacement format as bold. As a macro, this might be implemented along the following lines:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Text = "[!^13^11]@^0151[!^13^11]@[^13^11]"
    With .Replacement
      .ClearFormatting
      .Text = "^&"
      .Font.Bold = True
    End With
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 09-08-2016, 05:12 PM
jeffreybrown jeffreybrown is offline Bold a sentence containing an em dash Windows Vista Bold a sentence containing an em dash Office 2007
Expert
Bold a sentence containing an em dash
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Thank you Paul. Wish I could say I understand what's happening, but it works well.
Reply With Quote
  #8  
Old 09-08-2016, 05:34 PM
macropod's Avatar
macropod macropod is offline Bold a sentence containing an em dash Windows 7 64bit Bold a sentence containing an em dash Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,371
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

The 'Find' is a wildcard expression that looks for:
• any series of characters other than a paragraph break or line break - [!^13^11]@
• followed by an em-dash - ^0151
• followed by any series of characters other than a paragraph break or line break - [!^13^11]@
• followed by a paragraph break or line break - [^13^11]
The 'Replace' expression retains what is found - ^&

For more details, see:
http://www.gmayor.com/replace_using_wildcards.htm
http://word.mvps.org/FAQs/General/UsingWildcards.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 09-08-2016, 05:47 PM
jeffreybrown jeffreybrown is offline Bold a sentence containing an em dash Windows Vista Bold a sentence containing an em dash Office 2007
Expert
Bold a sentence containing an em dash
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Yes thanks Paul. I had seen those two sites, just wasn't understanding how it was strung together.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bold a sentence containing an em dash Adding bold colons at end of bold row headings bertietheblue Word Tables 2 07-26-2015 07:26 AM
Bold a sentence containing an em dash Text in #1 is made bold, rest of the document is edited, text in #1 is now not bold footer-assistance Word 1 06-29-2015 03:49 AM
Bold a sentence containing an em dash Delete does not bring second sentence closer to first sentence Andoheb Word 29 07-03-2014 01:48 PM
Format Bold in one line makes all lines bold Nitte Word 2 02-07-2013 12:34 AM
Bold a sentence containing an em dash Need Word to change -- (dash,dash) into one long dash. Bobosmite Word 2 05-06-2011 04:21 AM

Other Forums: Access Forums

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