GetPosition method

The GetPosition method gets the position of a field or character on a page. You can use this method for fields or characters that are located at identical positions on multiple pages in a batch.

  • For field objects, the position is defined by the Position variable of the field.
    <V n="Position">0,0,0,0</V>
  • For character objects, the position is defined by the cr attribute of the character.
    <C cn="10" cr="0,0,0,0">83</C>

Syntax

VBScript
oDCO.GetPosition(pnLeft as Long, pnTop as Long, nRight as Long, pnBottom as Long) as Boolean
C#
bool GetPosition(out object pnLeft, out object pnTop, out object pnRight, out object pnBottom)

Arguments

Argument Description
pnLeft Variable for the distance from the left side of the page to the left edge of the object (in pixels)
pnTop Variable for the distance from the top of the page to top edge of the object (in pixels)
pnRight Variable for the distance from the left side of the page to right edge of the object (in pixels)
pnBottom Variable for the distance from the top of the page to bottom edge of the object (in pixels)

Returns

Returns true if successful; returns false if unsuccessful.

Applies to

Field and character objects only.

VBScript example

This example gets a field's distance in pixels from the left, top, right, and bottom of a page, and displays the values in a message box.
Dim L,T,R,B
oDCO.GetPosition "L,T,R,B"
msgbox "The field's position is " L & "," & T & "," & R & "," & B

C# example

This example finds the Vendor field on a page, and gets the field's distance in pixels from the left, top, right, and bottom of a page.
m_oDCOField = m_oDCOPage.FindChild("Vendor");
object pLeft, pTop, pRight, pBottom;
m_oDCOField.GetPosition(out pLeft, out pTop, out pRight, out pBottom);