letter template, after comma of dear sir start nextline straight b

C

castle

On a letter template, afer the comma of the salutation i would lkie to start
the paragraph of the maim letter straight below it.

As i take the persons name from a form, the length of the salutation will be
different each time.

(Like this)

Dear Mr Jones,
With regard to our

(Not like this)

Dear Mr Willkinson,
With regard to our


.TypeParagraph
.TypeParagraph
.TypeText "Dear " & Form_FrmAddClient.lstTitle.Value & " " &
Form_FrmAddClient.txtSurname.Value & ","
.TypeParagraph
s = " With regard to our discussion on " &
Form_FrmAddClient.txtEnquiryDate.Value & ", this is a reminder of the details
for viewing your property on " & Form_FrmAddClient.txtViewingDate.Value & "
at " & Form_FrmAddClient.txtViewingTime.Value & ". If you have any further
queries, please contact me on 02877743333 or 07846243875."
.TypeText s
.TypeParagraph
.TypeParagraph
.TypeParagraph
 
D

Doug Robbins - Word MVP

I think that the easiest way to do this would be to start the next paragraph
with the "Dear Mr. personsname," and then format the font so that it is
White and will not be visible.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

castle

.TypeParagraph
.TypeText "Dear " & Form_FrmAddClient.lstTitle.Value & " " &
Form_FrmAddClient.txtSurname.Value & ", "
.Font.Color = wdColorWhite
s = "Thistextisforahiddenlineforahiddenlinefora"
.TypeText s
.Font.Color = wdColorBlack
s = "With regard to our discussion on

It comes out as this

Dear Mrs Dunn, ThistextisforahiddenlineforahiddenlineforaWith regard to our
discussion on



.TypeParagraph
.TypeText "Dear " & Form_FrmAddClient.lstTitle.Value & " " &
Form_FrmAddClient.txtSurname.Value & ", "
.Font.Color = wdColorWhite
s =
"Thistextisforahiddenlineforahiddenlineforahiddenlineforahiddenline"
.TypeText s
.Font.Color = wdColorBlack
s = "With regard to our discussion on "

This comes out as

Dear Mrs Dunn,
ThistextisforahiddenlineforahiddenlineforahiddenlineforahiddenlineWith regard
to our discussion on




.TypeParagraph
.TypeText "Dear " & Form_FrmAddClient.lstTitle.Value & " " &
Form_FrmAddClient.txtSurname.Value & ", "
.Font.Color = wdColorWhite
s =
"Thistextisforahiddenlineforahiddenlineforahiddenlineforahiddenlineforahiddenline"
.TypeText s
.Font.Color = wdColorBlack
s = " With regard to our discussion on "

This comes out as

Dear Mrs Dunn,
Thistextisforahiddenlineforahiddenlineforahiddenlineforahiddenlineforahiddenline
With regard to our discussion on 23/08/08, this is a reminder of the details
for viewing your property on


.TypeParagraph
.TypeText "Dear " & Form_FrmAddClient.lstTitle.Value & " " &
Form_FrmAddClient.txtSurname.Value & ", "
.Font.Color = wdColorWhite
s =
"Thistextisforahiddenlineforahiddenlineforahiddenlineforahiddenlinef"
.TypeText s
.Font.Color = wdColorBlack
s = " With regard to our discussion on "

this comes out as

Dear Mrs Dunn,
Thistextisforahiddenlineforahiddenlineforahiddenlineforahiddenlinef With
regard to our discussion on


but if i now put on a extra letter to the hidden line it comes out as

Dear Mrs Dunn,
Thistextisforahiddenlineforahiddenlineforahiddenlineforahiddenlinefo With
regard to our discussion on

I obviously need to stop the hidden going on to a new paragraph after the
comma when too much text is in, but how?


or try and put it all on one line

.TypeParagraph
.TypeText "Dear " & Form_FrmAddClient.lstTitle.Value & " " &
Form_FrmAddClient.txtSurname.Value & ", " & " " & .Font.Color = wdColorWhite
& " " &
"Thistextisforahiddenlineforahiddenlineforahiddenlineforahiddenlinefo" & " "
& .Font.Color = wdColorBlack
'.Font.Color = wdColorWhite
's =
"Thistextisforahiddenlineforahiddenlineforahiddenlineforahiddenlinefo"
'.TypeText s
'.Font.Color = wdColorBlack
s = " With regard to our discussion on "

it comes out as

True With regard to our discussion on
 
C

castle

Ok, i got it now!

A long word was bad so now using X x x x x x

.TypeParagraph
.TypeText "Dear " & Form_FrmAddClient.lstTitle.Value & " " &
Form_FrmAddClient.txtSurname.Value & ", "
.Font.Color = wdColorWhite
s = "x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
x x x x x x x x x x x x x x"
.TypeText s
.Font.Color = wdColorBlack
s = " With regard to our discussion on "
 
G

Graham Mayor

.TypeParagraph
.TypeText "Dear " & Form_FrmAddClient.lstTitle.Value & " " &
Form_FrmAddClient.txtSurname.Value & ", "
.Font.Color = wdColorWhite
.TypeText "Dear " & Form_FrmAddClient.lstTitle.Value & " " &
Form_FrmAddClient.txtSurname.Value & ", "
.Font.Color = wdColorBlack
s = " With regard to our discussion on "

Would surely be more appropriate to vary the length of the hidden text?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

castle

Yes, the x x x does vary it!!

Dear Mr Dunn,
With regard

Dear Mr Willkinson,
With regard

If the name is longer it pushes the x x x'es along more!
 
D

Doug Robbins - Word MVP

Use the following code (modified to suit your situation)

Dim salutation As String
Dim rHidden As Range
Dim rtext As Range

salutation = "Dear Mrs. Jones,"

ActiveDocument.Bookmarks("Salutation").Range.InsertBefore salutation
ActiveDocument.Bookmarks("FirstLine").Range.InsertBefore salutation
Set rHidden = ActiveDocument.Bookmarks("FirstLine").Range.Paragraphs(1).Range
Set rtext = rHidden.Duplicate
rHidden.End = rHidden.End - 1
rtext.Collapse wdCollapseEnd
rtext.Text = "This is the first line of text"
rHidden.Font.Color = wdColorWhite

Put a bookmark named "Salutation" where you want the "Dear so and so" to appear and put a bookmark named "First Line" at the beginning of the next paragraph, which should be empty.

That is, with the display of bookmarks and with the Show/Hide ¶ button active, you would have

I¶

I¶

When you run the above code, you will get

Dear Mrs. Jones,

Dear Mrs. Jones,This is the first line of text

where the T of This is located vertically below the space after the comma.

(It may not be displayed correctly due to limitations of the mail program)


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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