How to fix bottom of textbox relative to pagetop

R

RB Smissaert

I have a single page Word document with at the top a textbox holding an
address.
This address should show at the window of an envelope.
As the text in the text box can consist of 6 lines up to 8 lines I need a
way to fix
the bottom of this textbox relative to the top of the page. This is so that
the fold in the paper
can always be at the same place.
Any way to do this?

RBS
 
J

Jay Freedman

I have a single page Word document with at the top a textbox holding an
address.
This address should show at the window of an envelope.
As the text in the text box can consist of 6 lines up to 8 lines I need a
way to fix
the bottom of this textbox relative to the top of the page. This is so that
the fold in the paper
can always be at the same place.
Any way to do this?

RBS

There really isn't any way to fix the bottom position directly. The
best you can do is to fix the top position and the height, which
together locate the bottom. For example,

Dim oTBx As Shape
Dim strAddress As String
Dim i As Integer

For i = 1 To 7
strAddress = strAddress & "Line " & CStr(i) & vbCr
Next i
strAddress = strAddress & "Line " & CStr(i)

Set oTBx = ActiveDocument.Shapes.AddTextbox( _
Orientation:=msoTextOrientationHorizontal, _
Left:=0, _
Top:=InchesToPoints(1.25), _
Width:=InchesToPoints(4), _
Height:=InchesToPoints(1.75), _
Anchor:=ActiveDocument.Paragraphs(1).Range)
' note Top + Height = 4 inches

With oTBx
.RelativeVerticalPosition = _
wdRelativeVerticalPositionParagraph
.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionColumn
.LockAnchor = True
.TextFrame.TextRange.Text = strAddress
End With
 
R

RB Smissaert

Jay,

Thanks for that.
I had figured out something similar, but came to the conclusion that it was
better
to alter the addresses to make them all have the same number of lines.
Due to the size of the window this number is 5.

RBS
 

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