OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

java insertTextContent()

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
stifler
Newbie
Newbie


Joined: 28 Jan 2009
Posts: 4

PostPosted: Mon Feb 16, 2009 12:31 am    Post subject: java insertTextContent() Reply with quote

Here is the code
Code:

for (int i=0;i<count;i++){
         word.gotoEndOfWord(true);
         s=word.getString();
         word.gotoNextWord(false);
         if  (s.equals("SHAPE")){   
            XTextContent xTextContent =(XTextContent)UnoRuntime.queryInterface(XTextContent.class, oGraphic );
            linecursor.gotoEndOfSentence(true);//sensing the image
            System.out.println(linecursor.getString());
            xText.insertTextContent(xTextCursor, xTextContent, true);
            XPropertySet xPropSet=(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, oGraphic);
            File GifFile = new java.io.File("c:/2.gif");
             StringBuffer sUrl = new StringBuffer("file://");
             sUrl.append(GifFile.getCanonicalPath().replace('\\', '/'));
   
      }
   }
       xPropSet.setPropertyValue( "AnchorType",TextContentAnchorType.AT_PARAGRAPH );
       xPropSet.setPropertyValue( "GraphicURL", sUrl.toString() );
    xPropSet.setPropertyValue( "HoriOrientPosition",new Integer( 5500 ) );
       xPropSet.setPropertyValue( "VertOrientPosition",new Integer( 4200 ) );
       xPropSet.setPropertyValue( "Width", new Integer( 4400 ) );
   xPropSet.setPropertyValue( "Height", new Integer(4000 ));


error in line
Code:

xText.insertTextContent(xTextCursor, xTextContent, true);

what kind of error here
Back to top
View user's profile Send private message
stifler
Newbie
Newbie


Joined: 28 Jan 2009
Posts: 4

PostPosted: Mon Feb 16, 2009 10:15 pm    Post subject: Re: java insertTextContent() Reply with quote

anybody help
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Tue Feb 17, 2009 11:42 am    Post subject: Re: java insertTextContent() Reply with quote

stifler wrote:
anybody help

How should we help? You post only some part of your code, so it's hard to reproduce your error. You simple tell where the error occurs, but not which error. And you not even tell us your OOo version, OS and Java version...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group