Hi again,

I took your code and just added some lines. Here you are:

     XInterface xTextFrameInterface = (XInterface)
        mxDocFactory.createInstance("com.sun.star.text.TextFrame");

    XTextContent xFrameContent = (XTextContent)
        UnoRuntime.queryInterface(XTextContent.class,
            xTextFrameInterface);

    XTextRange xDocRange =
        (XTextRange)UnoRuntime.queryInterface(XTextRange.class,
            mxDocFactory);

    XText xText = xDocRange.getText();
    xText.insertTextContent(xDocRange, xFrameContent, false);

    XPropertySet xFramePropSet = (XPropertySet)
        UnoRuntime.queryInterface(XPropertySet.class,
            xTextFrameInterface);
    xFramePropSet.setPropertyValue( "FrameHeightAbsolute",
    new Long(5000));
    xFramePropSet.setPropertyValue(
        "FrameIsAutomaticHeight", Boolean.FALSE);
    xFramePropSet.setPropertyValue( "SizeType", new
        Short((short)1));


This should do the trick. Note that the text frame is inserted at the end of your document. See the description of "insertTextContent".

Regards, Steffen

Kent Gibson wrote:
please an example in java would be grand, this has
been a two day struggle.

kind regards,

kent


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

Reply via email to