| View previous topic :: View next topic |
| Author |
Message |
shammond42 Newbie

Joined: 22 Jun 2005 Posts: 2
|
Posted: Wed Jun 22, 2005 6:27 am Post subject: Copying Text Between Frames |
|
|
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 |
|
 |
Cybb20 Super User


Joined: 02 Mar 2004 Posts: 1569 Location: Frankfurt, Germany
|
Posted: Sun Jun 26, 2005 7:15 am Post subject: |
|
|
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 |
|
 |
shammond42 Newbie

Joined: 22 Jun 2005 Posts: 2
|
Posted: Sun Jun 26, 2005 12:18 pm Post subject: |
|
|
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 |
|
 |
|