Place Multiple lines of Text into Bookmark?

K

Kerri

Place Multiple lines of Text into Bookmark?

Hi,
I am using Word 2000 and a User Form. Is there a way to
place a hard return between two lines of text, when
inserting the text into a bookmark? All it will do is put
in the first line of text if I use the Case example for
Bankruptcy Court . If I use the modified Superior Court
example it will wrap to the next line in the wrong place.
I need the second quoted text to always appear on the
next line. Any suggestions??

Select Case cmbCourt.Value
Case "Superior Court": UpdateBookmarkText
ActiveDocument.Bookmarks("Court"), "IN THE SUPERIOR COURT
OF THE STATE OF ARIZONA" & " " & "IN AND FOR THE COUNTY OF
MARICOPA"

Case "Bankruptcy Court": UpdateBookmarkText
ActiveDocument.Bookmarks("Court"), "UNITED STATES
BANKRUPTCY COURT"
Selection.TypeParagraph
Selection.TypeText
Text:="DISTRICT OF ARIZONA"
End Select

Thank you for your help! Kerri
 
D

Doug Robbins - Word MVP

Hi Kerri,

Use

Select Case cmbCourt.Value
Case "Superior Court"
ActiveDocument.Bookmarks("Court").Range.InsertBefore "IN THE SUPERIOR COURT
OF THE STATE OF ARIZONA" & vbCr & "IN AND FOR THE COUNTY OF MARICOPA"
Case "Bankruptcy Court"
ActiveDocument.Bookmarks("Court").Range.InsertBefore "UNITED STATES
BANKRUPTCY COURT" & vbCr & "DISTRICT OF ARIZONA"
End Select

If you were to paste the above into the VBE there would be a couple of
linebreaks that will cause errors.

ActiveDocument.Bookmarks("Court").Range.InsertBefore "IN THE SUPERIOR COURT
OF THE STATE OF ARIZONA" & vbCr & "IN AND FOR THE COUNTY OF MARICOPA"

needs to be all on one line in the VBE.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 
K

Kerri Bourland

Hi Doug,

Thank you, Thank you, Thank you! =) You are wonderful, I would have never
figure that one out!

Kerri


Doug Robbins - Word MVP said:
Hi Kerri,

Use

Select Case cmbCourt.Value
Case "Superior Court"
ActiveDocument.Bookmarks("Court").Range.InsertBefore "IN THE SUPERIOR COURT
OF THE STATE OF ARIZONA" & vbCr & "IN AND FOR THE COUNTY OF MARICOPA"
Case "Bankruptcy Court"
ActiveDocument.Bookmarks("Court").Range.InsertBefore "UNITED STATES
BANKRUPTCY COURT" & vbCr & "DISTRICT OF ARIZONA"
End Select

If you were to paste the above into the VBE there would be a couple of
linebreaks that will cause errors.

ActiveDocument.Bookmarks("Court").Range.InsertBefore "IN THE SUPERIOR
COURT OF THE STATE OF ARIZONA" & vbCr & "IN AND FOR THE COUNTY OF MARICOPA"
 

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