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

Conclusion of the text since the set position.

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
lexus56
General User
General User


Joined: 01 Nov 2008
Posts: 20

PostPosted: Sun Nov 02, 2008 12:29 am    Post subject: Conclusion of the text since the set position. Reply with quote

It is necessary to deduce the text after a certain label in the text, but to make it it does not turn out in any way.
Code:

 arg = new Object[0];
                Object oText = Invoke(oComponent, "getText", BindingFlags.InvokeMethod, arg);
                //============================================================================
                Object SearchDesc = Invoke(oComponent, "createSearchDescriptor", BindingFlags.InvokeMethod, arg);
                arg = new object[1];
                arg[0] = "#desc#";
                Invoke(SearchDesc, "searchString", BindingFlags.SetProperty, arg);
                arg = new object[1];
                arg[0] = SearchDesc;
                Object found = Invoke(oComponent, "findFirst", BindingFlags.InvokeMethod,              arg);
found.goRight(6,false);
                arg = new object[3];
                arg[0] = found;
                arg[1]="ку-ку";
                arg[2]=false;
                Invoke(oText, "insertString", BindingFlags.InvokeMethod, arg);

Where is error in this code
Back to top
View user's profile Send private message
lexus56
General User
General User


Joined: 01 Nov 2008
Posts: 20

PostPosted: Mon Nov 03, 2008 4:54 am    Post subject: Re: Conclusion of the text since the set position. Reply with quote

lexus56 wrote:
It is necessary to deduce the text after a certain label in the text, but to make it it does not turn out in any way.
Code:

 arg = new Object[0];
                Object oText = Invoke(oComponent, "getText", BindingFlags.InvokeMethod, arg);
                //============================================================================
                Object SearchDesc = Invoke(oComponent, "createSearchDescriptor", BindingFlags.InvokeMethod, arg);
                arg = new object[1];
                arg[0] = "#desc#";
                Invoke(SearchDesc, "searchString", BindingFlags.SetProperty, arg);
                arg = new object[1];
                arg[0] = SearchDesc;
                Object found = Invoke(oComponent, "findFirst", BindingFlags.InvokeMethod,              arg);
found.goRight(6,false);
                arg = new object[3];
                arg[0] = found;
                arg[1]="ку-ку";
                arg[2]=false;
                Invoke(oText, "insertString", BindingFlags.InvokeMethod, arg);

Where is error in this code

Please help me!!!!
Back to top
View user's profile Send private message
jrkrideau
Super User
Super User


Joined: 08 Aug 2005
Posts: 6732
Location: Kingston ON Canada

PostPosted: Mon Nov 03, 2008 6:14 am    Post subject: Reply with quote

You might want to move this question to the Macros and API forum. The readers there are more likely to understand the problem.

However you should tell them what is happening when you run this code.

Also what OS and what version of OOo are you using?
_________________
jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
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 Writer 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