Community Forums Archive

Go Back

Subject:Paste Problem
Posted by: korigan
Date:2/12/2007 11:03:10 AM

Hello,
Since my previous email, I'm using now "TransportGoToEnd" to go to the end of window. It works fine.
But when I paste, it pastes at the begining of the file of my window and not at the end as I would like.
Any Idea ?

wnd.Active = true;
appSF.DoMenuAndWait("Edit.SelectAll",true);
appSF.DoMenuAndWait("Edit.Copy",true);

FileVoice.Window.Active = true;
appSF.DoMenuAndWait("Transport.GoToEnd",true);
appSF.DoMenuAndWait("Edit.Paste",true);

Subject:RE: Paste Problem
Reply by: korigan
Date:2/12/2007 11:41:10 PM

In fact, we just need to give time to Windows to put
the caret at the end of the file.
We have to call the Window's PumpWaitingMessages

appSF.DoMenuAndWait("Transport.GoToEnd",true);
Application.DoEvents();
// The caret is now at the end before the paste.
appSF.DoMenuAndWait("Edit.Paste",true);

Subject:RE: Paste Problem
Reply by: _TJ
Date:2/14/2007 12:31:25 PM

Yes, that will work.

You might also find it helpful to read up on the Methods and Parameters in ISfDataWnd, and ISfFileHost. DoMenu() is kindof a blunt instrument, and while it's easy to get started with, if you write more than a few scripts, knowing your way around ISfFileHost will pay off in the long run.

tj

Go Back