width and heigth of a formfield in a document

  • Thread starter Mickaël Désouches
  • Start date
M

Mickaël Désouches

Hello,
how can get the width and the height of a formfield in a document.
 
H

Helmut Weber

Hi,

are you looking for something like this?

Sub Makro1()
' wdHorizontalPositionRelativeToPage = 5
' wdVerticalPositionRelativeToPage = 6
Dim x1 As Single
Dim x2 As Single
Dim y1 As Single
Dim y2 As Single
Dim i As Integer
For i = 1 To ActiveDocument.Fields.Count
ActiveDocument.Fields(i).Select
Selection.Collapse
x1 = Selection.Information(5)
y1 = Selection.Information(6)
ActiveDocument.Fields(i).Select
Selection.Collapse Direction:=wdCollapseEnd
x2 = Selection.Information(5)
y2 = Selection.Information(6)
Debug.Print i & " " & x1 & " " & y1 & " " & x2 & " " & y2

Next
End Sub

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 

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