The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Just came
Rating: 1
Joined: Jul 31, 2014
Company:

How can I access the clipboard functionality via 1C script.

For example:

My company needs the option to generate some data and copy it to the clipboard by pushing a form button. So the user can paste the data into other applications (like Excel) easily. And vica versa: Paste from the clipboard into a SpreadsheetDocument only by a command. We operate on Windows-Machines.

Thanks in advance!

 
#2
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Oct 10, 2012
Company:

Hello, Oliver

1C script cannot operate with clipboard data directly but you can get it, for example, using WScript as a COM object:

Code
SystemInfo = New SystemInfo;

If SystemInfo.PlatformType = PlatformType.Windows_x86 
or SystemInfo.PlatformType = PlatformType.Windows_x86_64 Then  
    wsh = New COMObject("WScript.Shell");    
    // Copying text     
    wsh.SendKeys("^c");      
    // Pasting text  
    wsh.SendKeys("^v");
EndIf


Don't forget, COM objects are allowed for applications that run on Windows and only.

 
Subscribe
Users browsing this topic (guests: 2, registered: 0, hidden: 0)