How to add 2 new paragraphs?

A

avkokin

Hello.
There is some text. I need to move to end this text and add 2 new
paragraphs. I am doing:
With Selection
.EndKey wdStory
.TypeParagraph
.TypeParagraph
End With

But it is some irrationally.
Please give me tips.
Thank you very much.
 
J

Jean-Guy Marcil

avkokin said:
Hello.
There is some text. I need to move to end this text and add 2 new
paragraphs. I am doing:
With Selection
.EndKey wdStory

This takes you to the end of the document.
.TypeParagraph
.TypeParagraph
End With

But it is some irrationally.
Please give me tips.
Thank you very much.

Try this:

Selection.Range.InsertAfter vbCrLf & vbCrLf
 
S

StevenM

To: Jean-Guy Marcil,

Just out of curiosity, why vbCrLf and not just vbCr?

It is my understanding (and perhaps I'm mistaken) that for Word documents,
only vbCr is needed, and that vbCrLf is used for text files. Am I mistaken?

Steven Craig Miller
 
J

Jean-Guy Marcil

StevenM said:
To: Jean-Guy Marcil,

Just out of curiosity, why vbCrLf and not just vbCr?

It is my understanding (and perhaps I'm mistaken) that for Word documents,
only vbCr is needed, and that vbCrLf is used for text files. Am I mistaken?

I do not believe that it makes a diference in VBA. I have just always used
vbCrLf becasue it makes sense to me... (i.e you should need both a carriage
return and a line feed... I guess becasue I have actually used a typewriter,
it warps my perception...!)
 
S

StevenM

To: Jean-Guy Marcil,

Yeah, well, I remember the typewriter too. I taught myself BASIC duing High
School. My highschool didn't have a computer, but allowed students to use a
teletype which was connected to another school's mainframe. We had to store
our computer programs on 1" wide paper ribbons. The PC was still a thing of
the future, and an "apple" was a type of fruit.

I was just curious. I guess it is neither here nor there. I have often been
impressed with your coding (as well as your willingness to help others,
including myself) and so I just wondered if there was some reason behind it.

Steven Craig Miller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top