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 / March 2005

Tip: Looking for answers? Try searching our database.

What is the equivalent of "^p" in tables ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Svendsen - 20 Mar 2005 14:05 GMT
Hi All,

I need to delete blank characters at the end of text in tables.
To do this in normal text (non-table) all I do is replace " ^p" (blank
before ^p) with "^p", but I cannot find the equivalent of ^p for tables
(that circle with 4 dots) - is this something easy, that I'm simply missing
?!?
Tks, JS
Greg Maxey - 20 Mar 2005 15:15 GMT
John,

You can use ^w for whitespace.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Hi All,
>
[quoted text clipped - 4 lines]
> simply missing ?!?
> Tks, JS
John Svendsen - 20 Mar 2005 17:36 GMT
Hi Greg,

Thanks for your reply, but what I need is the code for the carriage return

in tables (equivalente to ^p) - ^w is the same as " ".

Again, thanks for your interest.

JS

> John,
>
[quoted text clipped - 8 lines]
> > simply missing ?!?
> > Tks, JS
Greg Maxey - 20 Mar 2005 18:08 GMT
Oh,  I thought you just wanted to delete white space between cell text and
the end of cell marker.

The end of cell marker is defined by two characters Chr(13) and Chr(7)

You can prove this with a snippet of code the JGM has posted previouslty:

Type:  John in a cell, select it and run this code:

Sub CellContent()

Dim CellText As String
Dim CelLen As Long
Dim i As Integer

CellText = Selection.Range.Text
CelLen = Len(CellText)

For i = 1 To CelLen
   MsgBox "Character # " & i & " is " _
       & "Chr(" & Asc(Mid(CellText, i, 1)) & ")"
Next

End Sub

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Hi Greg,
>
[quoted text clipped - 25 lines]
>>> I'm simply missing ?!?
>>> Tks, JS
Al - 22 Mar 2005 00:06 GMT
> Hi All,
>
[quoted text clipped - 4 lines]
> simply missing ?!?
> Tks, JS

This will delete the blank line at the end of all cells.

Sub TableCellLast()
'
' TableCellLast Macro
'
'
Dim tableLoop As Table
Dim cellLoop As Cell
For Each tableLoop In ActiveDocument.Tables
   For Each cellLoop In tableLoop.Range.Cells
     While Right(cellLoop.Range.Text, 3) = Chr(13) & Chr(13) & Chr(7)
       cellLoop.Range.Characters.Last.Previous.Delete
     Wend
   Next cellLoop
Next tableLoop
End Sub
 
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.