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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word table hidden character explanation needed...

Status
Not open for further replies.

dcorleto

MIS
May 19, 2002
82
US
I have tables made in word, and at the end of the lines there are different characters. I am familiar with the paragraph marks, but there are others that look like a small star or circle with lines coming out of it. Can anyone tell me what the difference is, and what they mean?

 
They are essentially paragraph marks. You can test this.

Make a new document with a table of 3 row / 3 columns. This equals 9 cells, correct.

Do NOT use Tools > Word Count. It lists the paragraphs as = 0.

In the ThisDocument code mode put in the following Sub.

Code:
Sub ParaCount()
MsgBox ActiveDocument.Paragraphs.Count
End Sub

This will display a count of 13. Why 13? Each cell has a separator (essentially a paragraph mark). Nine cells, so there is 9 paragraphs. Each row has that little circle thingie which marks the end of the row (and is also essentially a paragraph mark), so 3 more. Total is 12. Plus the paragraph mark that is at the end of all documents. Total = 13.

Word uses these paragraph marks to delineate between cells. Each cell can have its own style applied to it. Styles are applied to paragraphs.

Paragraph marks also represent the termination of range objects. For example, if you put the following into the above code, like this:

Code:
Sub ParaCount()
MsgBox ActiveDocument.Paragraphs.Count
ActiveDocument.Paragraphs(3).Range.Select
End Sub

It will display the messagebox with "13", then select the 3rd cell in the table - as it is paragraph #3.

Just rememebr this is a document with the mentioned table right at the beginning...so there are no paragraphs before the table. If there was, say, two paragraphs before the table, then the third cell/row 1 would be:

ActiveDocument.Paragraphs(5)



Gerry
 
Hi,
They are end-of-line table markers and are only visible when the Show/Hide tool is enabled. If you highlight this column of markers and right click, you can easily add a new column to your table.
HTH,

Best,
Blue Horizon [2thumbsup]
 
They are still counted as paragraph marks, and are exactly equivalent to the (if you like) "end-of-cell markers", but are, in fact, paragraph marks. They display differently from "regular" paragraph marks, as they are in a different context (marking the end of the .Range property of the Rows collection of a table object - or marking the end of the .Range property of the Cells collection of the Rows object).

And yes, highlighting the "end-of-table" markers lets you add another column...with a right click > Insert column.

Gerry
 
Hi dcorleto,

As ever Gerry gives a very good explanation but Kathy is correct in that the characters are end-of-row markers and are, if you like, a special case of paragraph mark.

When Show Paragraph Marks is enabled, normal ends of paragraphs display as pilcrows while the end of row markers (and end of cell markers) display as a circle with 4 little lines (I have no idea what the symbol is called).

Normal paragraph marks are character code 13. End of cell and end of row marks are actually dual characters, character code 13 followed by character code 7.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Hi Tony,

The end-of-cell marker, and the end-of-row markers do indeed contain Chr(13) followed by Chr(7) or BEL (bell).

I never stated that they were not end-of-cell, or end-of-row markers. However, that is their function - not their attribute. Their attribute is Chr(13) or a paragraph mark. Word counts them as paragraphs.

Go into an empty cell in a table and do a Selection.TypeText Text:= Chr(7). Hey presto. You have another "end-of-cell" marker. Do this five times and...you have FIVE "end-of-cell" markers. Please explain to me how you can have multiple "end-of-cell"s, in a single cell? It is not as if the cell entered Reichmann space and is now multi-dimensional.

These will persist, as long as NO Chr(13) is entered into the cell. The Chr(7) - or "Circle" by the way - will take up space in the cell. They cause the cell to expand. You can enter text after them, or before them. As long as you do not actually enter an Enter (Chr(13) you can, in fact, use Chr(7) (the "end-of'cell" markers) as...you guessed it...paragraph marks.

Extra Chr(7) BY THEMSELVES IN A CELL, will display for as long as there is no new text entered into the cell. That is, no text followed by Chr(13). When Chr(13) is entered, the Chr(7) (all of them) collapse, or I guess you would say, deleted. If you backspace the Chr(13), hey presto, the Chr(7) return.

Doing the exact same thing OUTSIDE a cell does not duplicate the behaviour. This is because what drives the behaviour is a the Long Integer of the character. If the location integer is within the Range of a Cell, or Row, or Column then it acts as an "end-of-cell" marker, but is actually, you guessed it...a paragraph mark (but only in the range of a cell, rows, column collection).



Gerry
 
Hi Gerry,

Well, well, well. I knew Word did some odd things but I never realised that there were characters whose treatment depended on context. Thankyou.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
The Word object model is a delight of the bizarre and the sane, the reasonable and the utterly ridiculous.

What I can not for the life of me figure out is:

If you have, say, five Chr(7) in a table cell, and then enter a Chr(13), the Chr(7) (the "Circle") are removed. Fair enough. There is now a "real" paragraph mark.

But why on earth, if you backspace the paragraph mark, do the Chr(7) return? This means that Word is storing the Chr(7)s. Just in case the Chr(13) is removed? Stored where? In a collection somewhere. In BizarreCharacterCodesThatWeMayNeedAgain()?

I doubt if I will ever stop learning...or shaking my head.

Gerry
 
Hi Gerry,

I think there's a complete ElephantsMemory object with its own hidden Object Model. One I particularly like is the ThingsIDidAsAKid Collection. Every now and again one silly mistake you made long long ago, when you were still running Word 2.0, comes back to haunt you. And then there's the ThoughtYouUnderstood property which, when true, introduces occasional random behaviour.

Learning and shaking with you ...

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Thanks Tony. I just got into the office and had a very enjoyable morning laugh. Do you would know the properties of the ICanProbablyDoThisButWon'tTellYouHow collection? I keep trying to use the Application.PssstItIsASecret method, but keep getting the message "ERROR:Numbskull".

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top