Yes they are stored as property values "Hori" and "Vert" OrientPosition
Folowing code shows in basic how to uses postion and reposition a simple graphic, objects, frames etc uses the same services (i think)


        oGraphic.AnchorType = lAnchor
        oGraphic.PositionProtected = True
    oGraphic.SizeProtected = True
    oGraphic.ContentProtected = True
 oGraphic.width = iFotW
 oGraphic.height = iFotH
 oGraphic.HoriOrient = NONE
 oGraphic.VertOrient = NONE
 oGraphic.VertOrientRelation = PAGE_PRINT_AREA
 oGraphic.HoriOrientRelation = PAGE_PRINT_AREA


oGraphic.SetPropertyValue("AnchorPageNo", iPagenr)
oGraphic.HoriOrientPosition = iHCpos - AflpL + 900 'left Pagemargin
oGraphic.VertOrientPosition = iVCpos - AflpB + iif(oDialog.Model.viaCursor.State = 1, 1080, 1100) 'top Pagemargin + linefeed als via cursor
aCrop.Left = (((iOriFotW - iFotW)/2) +((iMoveH*3)/2/96*2540))
aCrop.Right = (iOriFotW - iFotW - aCrop.Left )
aCrop.Top = (((iOriFotH - iFotH)/2) + ((iMoveV*3)/2/96*2540))
aCrop.Bottom = (iOriFotH - iFotH - aCrop.Top)
oGraphic.SetPropertyValue("GraphicCrop" , aCrop)
dim SFilename as string
sFilename = FileNameoutofPath(sGraphicURL , "/")
oGraphic.SetPropertyValue("HyperLinkName" , sFilename)
oGraphic.Name = "Fot" + "_" + iPagenr + "_" + iHCpos +"_" + iVCpos + "_" + (tot + 1) ' moet telkens uniek zijn


Fernand


At 14:42 17/03/05, you wrote:

Michael Hoennig wrote:

I was wondering if there is a way of getting the position of elements
(graphics objects, embedded objects, drawing elements, frames) in a Writer
document relative to the page?

All these are Shapes, but getPosition() is not implemented, most likely
because it is not known on the model level (just on the view level).

Is there another way, I don't know about?  Like through accessibility API?

        Michael

This is just a guess, but..... Can you position the view cursor to the anchor and then figure out where the view cursor is? I have not tried it and a I doubt that it will work with all types of anchors.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info:  http://www.pitonyak.org/oo.php


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to