Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word search special character for cells ?

Status
Not open for further replies.

richardchaven

Programmer
Jan 13, 2003
161
US
I want to search and replace in MS Word using their special characters to indicate the edge of a table cell. ^p stands for a paragraph, but that does not work (regardless of what RTF looks like).


Cheers
 
Can you tell us what you're trying to do instead of how?
I doubt an end of cell marker is replaceable since it's part of a table. Now, if you wanted, you could convert the table to text and use a delimiter. That would effectively be doing the same thing...

Anne Troy
Killer Coder Live Chat!
 
I want to remove trailing spaces from text inside a table. Outside of a table, I use FindText:=" ^p",ReplaceText:="^p", but as the delimiter for cell data is not a paragraph mark, I don't know how to phrase it.

Cheers
 
I'm sure the chance of your paragraph alignment being set to "Left" in all columns of your tables is "slim to none", so the following may not be feasible for you to use.

You can strip out all trailing spaces by...
Select > Table
Click Center on the Formatting toolbar
Click Left on the Formatting toolbar
Arrow Left once (to exit Select mode)

Note: The TOOLBAR BUTTONS must be used when doing the paragraph alignment. Doing it through the menu (Format > Paragraph > Centered / Left) does not work. Also, this "Center / Left trick" is what I use when I copy and paste from a web page and there are leading and/or trailing spaces that I want to strip out.

Code for the above would be:
Code:
Application.Browser.Target = wdBrowseTable
Application.Browser.Next
Selection.Tables(1).Select
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
Selection.MoveRight Unit:=wdCharacter, Count:=1
Unfortunately, I don't know how to tell it...
For Each... Next Loop
Anyone?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top