View Single Post
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
JoAnn Paules JoAnn Paules is offline
external usenet poster
 
Posts: 4,241
Default End of document paragraph symbol

Have you tried asking your professor that question? You've paid for his
instruction - get your (or your parents') money's worth.

--
JoAnn Paules
MVP Microsoft [Publisher]
Tech Editor for "Microsoft Publisher 2007 For Dummies"



"TestThis4x4" wrote in message
...
Wow! I didn't realize it was so involved! I'm taking a course on computer
integration and my professor's noted in my homework assignment:

"There are to be no additional paragraph symbols at the end of the
document
even if the file that is downloaded has them. There are also to be no
additional blank pages at the end of the document. Do not use multiple
spaces
or tabs to align text. I suggest students have show on so they can see all
the hidden symbols (tabs, spaces, paragraphs, page breaks)."

So I got credit marked off my assignment because I had a paragraph symbol
at
the end of my document.

Do I understand the professor correctly?

"Greg Maxey" wrote:

On Sep 21, 3:33 pm, TestThis4x4
wrote:
How do you remove just the LAST paragraph symbol in a document? All the
others can stay but the last one needs to be removed.


I don't think the correct answer is "you can't". It is more like, if
you do then the last paragraph container just recreates itself. Mr.
Daniels is correct. The last paragraph container stores much of the
formatting information about the document.

The following example macros should illustrate.

Open a new blank document (lets call it demo doc) and type ten
paragarphs as shown below. Use the page setup dialog to change the
default margins to say (.5, .5, .5 and .5)

1
2
3
4
5
6
7
8
9
10

Carefully select and copy everything but the last paragraph mark.
Open a new document and paste the contents. The new document page
setup (margins) should be unchanged. Close the new document.

Carefully select and copy everything in demo doc including the last
paragraph mark. Open a new document and paste the contents. The new
document page setup (margins) should change to match those set in demo
doc. This is because that last paragraph mark stores page setup
information about a document.

Now with demo doc select and delete the last paragraph or run the
following code:

Sub Demo()
ActiveDocument.Paragraphs.Last.Range.Delete
End Sub

The result is:

1
2
3
4
5
6
7
8
9

The last paragraph was deleted (no code error) but the page setup
doesn't change. You can extend this demo with the following code:

Sub ScratchMacro()
Do While ActiveDocument.Paragraphs.Count 0
If Len(ActiveDocument.Paragraphs.Last.Range.Text) 1 Then
MsgBox ActiveDocument.Paragraphs.Last.Range.Text
ActiveDocument.Paragraphs.Last.Range.Delete
Else
If MsgBox("Deleting last paragraph which will automatically
recreate. Do you want to continue?", vbQuestion + vbYesNo, "End of
the Road") = vbYes Then
ActiveDocument.Paragraphs.Last.Range.Delete
Else
Exit Sub
End If
End If
Loop
End Sub

It will run indefinately or until tire of proving it otherwise as each
time the final paragraph is deleted it will recreate itself.