I am not sure, but, hopefully, this could be a hint.

After manually inserting a graphic image into an empty Writer document,
the following code fragment of OpenOffice.org Basic reports that

        HoriOrientRelation = 7
        VertOrientPosition = 7

Sub Main
        oObject = ThisComponent.getDrawPage().getByIndex(0)
        print "AnchorType = "         & oObject.AnchorType
        print "Height = "             & oObject.Height
        print "Width = "              & oObject.Width
        print "HoriOrient = "         & oObject.HoriOrient
        print "HoriOrientPosition = " & oObject.HoriOrientPosition
        print "HoriOrientRelation = " & oObject.HoriOrientRelation
        print "VertOrient = "         & oObject.VertOrient
        print "VertOrientPosition = " & oObject.VertOrientPosition
        print "VertOrientRelation = " & oObject.VertOrientRelation
End Sub

They seem to be described at
http://api.openoffice.org/docs/common/ref/com/sun/star/text/RelOrientation.html


An export filter for Microsoft Word 97-2003 (not for 2007, though) has some 
relevant code.
http://svn.services.openoffice.org/ooo/tags/OpenOffice_3_1_1/sw/source/filter/ww8/wrtw8esh.cxx

bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri, ...
{
...
    // convert horizontal position, if needed
    {
        enum HoriConv { NO_CONV, CONV2PG, CONV2COL, CONV2CHAR };
        HoriConv eHoriConv( NO_CONV );
...
                case text::RelOrientation::PAGE_FRAME:
                case text::RelOrientation::PAGE_PRINT_AREA:
                {
                    if ( bConvDueToOrientation || bFollowTextFlow )
                        eHoriConv = CONV2PG;
                }
...
                case text::RelOrientation::FRAME:
                {
                    if ( bConvDueToOrientation )
                        eHoriConv = CONV2COL;
                }
...

Tora


Chris Fleischmann wrote:
OpenOffice 3.1.1. Java SDK, MAC OS X 10.6.2, MS Word 2007/2008.

Firstly I am happily able to position my TextGraphicObject's where I need
them, ie., I use the following code to position the TextGrahicObject in
OpenOffice with a particular width and height:

            xProps.setPropertyValue("HoriOrient", new 
Short(HoriOrientation.NONE));
            xProps.setPropertyValue("HoriOrientPosition", new Integer(pos_x));

However when I open up the document in MS Word, the image, has been
left-aligned (lots its X position) and lots its Y position?

Is there a way to make sure the position is maintained in both OOo and MS
Word?

Thanks in advance,

Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to