Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

delete blank line in table cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
john smith - 05 Sep 2006 22:25 GMT
Hi,

I have 3 paragraphs in a table cell. Each paragraph separated by a blank
line. I'd like to delete the blank line so that all paragraphs aren't
separated anymore.

Example:
line1 sentences paragraph

line2 sentences paragraph

line3 sentences paragraph

Wanted:
line1 sentences paragraph
line2 sentences paragraph
line3 sentences paragraph

Code so far:
   For tblIdx = 1 To ActiveDocument.Tables.Count
       Set theTable = ActiveDocument.Tables(tblIdx)

       If Mid(theTable.Cell(2, 2).Range.Text, 1, 23) = "Scenario and
Conditions" Then
           With Selection.Find
               .Text = "^p"
               .Replacement.Text = ""
               .Forward = True
               .Wrap = wdFindContinue
               .Format = False
               .MatchCase = False
               .MatchWholeWord = False
               .MatchWildcards = False
               .MatchSoundsLike = False
               .MatchAllWordForms = False
           End With
           Selection.Find.Execute Replace:=wdReplaceAll
       End If
   Next

Would anyone know how to delete the blank lines in all of table cells?

Please help me! Thank you so muchh...
John
Doug Robbins - Word MVP - 06 Sep 2006 04:46 GMT
Just do a search for ^p^p and replace it with ^p.  If that screws up the
spacing elsewhere in the document, select the paragraphs affected and format
them with space before or after as they should have been formatted in the
first place.

Using two carriage returns to separate paragraphs with a blank line is a
practice that should have gone out with the carriage.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hi,
>
[quoted text clipped - 40 lines]
> Please help me! Thank you so muchh...
> John
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.