I want to force Word to put some text at at specific horizontal and vertical
position on a page, preferably using inches to specify the location.
How is that done?
You can use a text box, a frame, or a table cell, any of which can be
positioned in absolute terms with respect to the paper. Here's an
example using a text box:
Sub x()
' place a text phrase exactly at
' 3.52" from top of paper and
' 2.71" from left edge of paper
Dim oTB As Shape ' a text box
Set oTB = ActiveDocument.Shapes.AddTextbox( _
Orientation:=msoTextOrientationHorizontal, _
Left:=0, _
Top:=0, _
Width:=InchesToPoints(3), _
Height:=InchesToPoints(1), _
Anchor:=ActiveDocument.Paragraphs(1).Range)
With oTB
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
.Left = InchesToPoints(2.71)
.Top = InchesToPoints(3.52)
.TextFrame.TextRange.Text = "This is my text"
.TextFrame.MarginTop = 0
.TextFrame.MarginLeft = 0
.Line.Visible = msoFalse
.Fill.Visible = msoFalse
End With
End Sub
A frame might be easier to program, but it's getting late...