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

Copying Text Between Frames

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


Joined: 22 Jun 2005
Posts: 2

PostPosted: Wed Jun 22, 2005 6:27 am    Post subject: Copying Text Between Frames Reply with quote

I've got a writer document with two frames. I want to copy the text typed in one into the other.

I've got the following code bound to alphanumeric and non-alphanumeric events in the first frame.

Code:

Sub CopyText
   Dim oDoc as Variant
   oDoc = ThisComponent

    ' Get the collection of frames.
    oFrames = oDoc.getTextFrames()
   
    ' Ask for a specific frame from the collection by name.   
    oInFrame = oFrames.getByName( "TextInputFrame" )    
    oOutFrame = oFrames.getByName( "StyledText" )
    wait 1000
   oOutFrame.Text.String = oInFrame.Text.String
End Sub


This works except that the macro seems to be called before the pressed character is added to the first frame. This results in the second frame being 1 character behind the first. I can't find a different event to bind do, is there a better way to handle this?

Thanks,
Steve
Back to top
View user's profile Send private message
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Sun Jun 26, 2005 7:15 am    Post subject: Reply with quote

what is the event you're really talking about?
The copying function seems fine to me, thus it's not the problem of the macro you posted but rather the problem *when* it is called, thus the event handler.

Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
shammond42
Newbie
Newbie


Joined: 22 Jun 2005
Posts: 2

PostPosted: Sun Jun 26, 2005 12:18 pm    Post subject: Reply with quote

I've associated that action with both the alphanumeric character press and the non-alphanumerica characters in the Macros section of the Frame properties dialog.

You're right that it is the timing of the event. Is there another event available?

Thanks,
Steve
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