Microsoft Office Forums Replace paragraph-marks (line-breaks) in tables with a character-string

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2013, 07:01 AM
Aztec Aztec is offline Replace paragraph-marks (line-breaks) in tables with a character-string Windows 7 64bit Replace paragraph-marks (line-breaks) in tables with a character-string Office 2007
Novice
Replace paragraph-marks (line-breaks) in tables with a character-string
 
Join Date: Apr 2013
Posts: 2
Aztec is on a distinguished road
Default Replace paragraph-marks (line-breaks) in tables with a character-string

I've got several documents that contain tables and am looking for a way to replace all the paragraph-markers (line-breaks) in all tables with a specified character-string.



Any help will be greatly appreciated.
Reply With Quote
  #2  
Old 04-02-2013, 07:22 PM
macropod's Avatar
macropod macropod is offline Replace paragraph-marks (line-breaks) in tables with a character-string Windows 7 64bit Replace paragraph-marks (line-breaks) in tables with a character-string Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,536
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

You could use code like:
Code:
Sub ProcessTables()
Application.ScreenUpdating = False
Dim Tbl As Table
With ActiveDocument
  For Each Tbl In .Tables
    With Tbl.Range.Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .Forward = True
      .Wrap = wdFindStop
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
      .Text = "^p"
      .Replacement.Text = "???"
      .Execute Replace:=wdReplaceAll
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
Simply change the '???' to whatever your replacement string should be.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 04-02-2013, 10:52 PM
Aztec Aztec is offline Replace paragraph-marks (line-breaks) in tables with a character-string Windows 7 64bit Replace paragraph-marks (line-breaks) in tables with a character-string Office 2007
Novice
Replace paragraph-marks (line-breaks) in tables with a character-string
 
Join Date: Apr 2013
Posts: 2
Aztec is on a distinguished road
Default

Thx Paul!!!
Exactly what i needed...
I'm kinda new to vba and this looks like "the" place to pick up some tricks.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace paragraph-marks (line-breaks) in tables with a character-string How to delete all the punctuation marks from a paragraph? Jamal NUMAN Word 3 02-26-2019 02:33 PM
Replace paragraph-marks (line-breaks) in tables with a character-string Find and replace a string of text errtu Word 1 01-31-2013 02:09 PM
Replace paragraph-marks (line-breaks) in tables with a character-string Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM
Replace paragraph-marks (line-breaks) in tables with a character-string Paragraph line breaks muymalestado Word 3 09-25-2011 05:06 AM
Replace paragraph-marks (line-breaks) in tables with a character-string Hide paragraph format marks Cara Word 2 04-07-2011 10:26 AM


All times are GMT -7. The time now is 10:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft