Prev: Delete Style Set
Next: Selecting text inside a cell
From: LA Lawyer on 24 Apr 2010 19:37 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?
From: Jay Freedman on 24 Apr 2010 21:13 On Sat, 24 Apr 2010 16:37:40 -0700, "LA Lawyer" <hkapp(a)kapplaw.com> wrote: >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... -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
From: Doug Robbins - Word MVP on 24 Apr 2010 21:12 Use an { ADVANCE } field to set the vertical position and probably paragraph indents for the horizontal. -- 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, originally posted via msnews.microsoft.com "LA Lawyer" <hkapp(a)kapplaw.com> wrote in message news:#a4hgcA5KHA.5880(a)TK2MSFTNGP04.phx.gbl... > 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? >
|
Pages: 1 Prev: Delete Style Set Next: Selecting text inside a cell |