>Thanks, Sergey -- that is what I expected. > > >>As is, it can be called from ON KEY LABEL or a toolbar baton. In any other place you'll have to figure out how to get a handle on the window you're interested in. >> >>> >>>How can this code be invoked? Only using 'On Key Label', or is there some other technique as well? >>> >>>Thanks >>> >>>>See http://www.berezniker.com/content/pages/visual-foxpro/copy-command-window-selected-text-clipboard-programmatically and http://www.berezniker.com/content/pages/visual-foxpro/copy-prg-contents-clipboard >>>> >>>>>Is it possible to create a keyboard macro that will extract the marked text from the currently opened window (presumably method code)? >>>>> >>>>>If so, are there any examples available to do this? >>>>> >>>>>Thanks in advance