Another Easy Word-VB Question

Allright.  I am having VB place text  in my word document that I'm formatting to be centered.  After it does this, I need to go to the end point of that insert, move down 2 lines, and begin inserting again, but formatted to the left like a normal text.  The way I have it set up is that I can't break the selection and it continues to format center.

I'd like to find a command that releases the current selection and starts a new selection where the cursor is currently at.  Any ideas?

rick

ps:  I'm using word visual basic, not the full version of it.
saksafon2Asked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
I assume that appWord is a reference to the Word Appliation and that the document is currently selected:
  appWord.Selection.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
  appWord.Selection.TypeText "THIS IS CENTERED" & vbCrLf & vbCrLf
  appWord.Selection.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft
  appWord.Selection.TypeText "THIS IS LEFT" & vbCrLf
0
 
gogsCommented:
1. start recording a macro
2. perform the required action
3. stop recording the macro
4. edit the created macro to see the required calls.
0
 
saksafon2Author Commented:
Edited text of question.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
saksafon2Author Commented:
I'm not talking anything about macro's in this situation.  I need VB code that will stop selecting and start a new one.. sorry..

rick
0
 
saksafon2Author Commented:
It doesn't work in Word Basic.  What happens is the centering command centers the first comment and then the left commadn left's the entire paragraph, both of them.  I'm looking for the way to:

1.  Write the 1st paragraph
2.  Center the first paragraph
3.  Release the selection
4.  Write the 2nd paragraph
5.  Left the 2nd paragraph

it's the release part that's making this difficult.

meh!

rick

0
 
saksafon2Author Commented:
Hm.  I played with it and somehow I think what you said led to me fixing my problem in some odd way.  Anyways.

Thanks.

rick
0
 
gogsCommented:
i just meant that by reading the wordbasic commands in the macro created you will be able to see how to unselect text and therefore be able to apply the new formatting to the next paragraph from withing the vb wordbasic calls.

Gogs
0
All Courses

From novice to tech pro — start learning today.