I think the title says it all - is it possible to programmatically copy/paste some text to/from the windows clipboard using MapBasic?

I have found this discussion but it only discusses copying and as it's two years and 1.5 versions ago I'm wondering if there's a better/more native option.

  • What is the text you are trying to copy? For instance is it a attribute of an object or an object from a layout? – James S Jun 14 '11 at 12:58
  • The result of WindowInfo(FrontWindow(), WIN_INFO_CLONEWINDOW). I want to have two instances of MapInfo open and easily copy a layout window between them. – Mr_Chimp Jun 14 '11 at 13:36

To copy the objects from the layout onto the clipboard you can do the following:

dim strLayWinName As String
strLayWinName = WindowInfo(FrontWindow(), 10) ' assuming layout window is front window
Select * From strLayWinNAme
Run Menu Command 203

You will then need to work out how to switch instances of MapInfo (or just open a new one). Then you need to set your layout window as the Front Window. Then run:

Run Menu Command 204

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.