LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

copy table to clipboard for use in word


@mischl wrote:

ok, thanks a lot for your guiding smercurio_fc.

 

i've made an example in labview now with accessing user32.dll, but writing into the clipboard itself doesn't work and i could not find out why.... attached the vi.

 

i have integrated the order as used here: http://forums.ni.com/t5/LabWindows-CVI/Copy-amp-Paste-with-RTF/m-p/638601/thread-id/33345

as well as here (both are the same). http://msdn.microsoft.com/en-us/library/windows/desktop/ms649016%28v=vs.85%29.aspx#_win32_Copying_In...

 

any help would be very useful! thanks in advance

 

btw: does this dll access also work in an exe later and is user32.dll also available on 64 bit systems? (i use 64bit by myself and it works...)


You do realize that that Array to Spreadsheet string is not going to create the RTF string that will result in a table in Word?

 

http://www.ml-consult.co.uk/foxst-35.htm

 

 

0 Kudos
Message 11 of 14
(756 Views)

@mischl wrote:

ok, thanks a lot for your guiding smercurio_fc.

 

i've made an example in labview now with accessing user32.dll, but writing into the clipboard itself doesn't work and i could not find out why.... attached the vi.


Two problems:

  1. As nyc alluded to, the string "test" is not valid rich-text format. Rich text format has a specific structure. http://en.wikipedia.org/wiki/Rich_Text_Format
  2. (the bigger problem) You can't just wire a string to the SetClipboardData. You have to allocate memory and then copy the string's buffer to that buffer, and pass the handle for that buffer to the SetClipboardData. Look back at the original example from the Microsoft KnowledgeBase that you posted: http://support.microsoft.com/kb/216676
0 Kudos
Message 12 of 14
(749 Views)

@mischl wrote:

ok, thanks a lot for your guiding smercurio_fc.

 

i've made an example in labview now with accessing user32.dll, but writing into the clipboard itself doesn't work and i could not find out why.... attached the vi.

 

i have integrated the order as used here: http://forums.ni.com/t5/LabWindows-CVI/Copy-amp-Paste-with-RTF/m-p/638601/thread-id/33345

as well as here (both are the same). http://msdn.microsoft.com/en-us/library/windows/desktop/ms649016%28v=vs.85%29.aspx#_win32_Copying_In...

 

any help would be very useful! thanks in advance

 

btw: does this dll access also work in an exe later and is user32.dll also available on 64 bit systems? (i use 64bit by myself and it works...)


This post contains an llb that implements the clipboard access properly. You will see that it is not so trivial as you have thought. But looking at it, I noticed a problem. This was written long before anybody knew what a 64 bit CPU would be and how it will work and even longer before LabVIEW had any support for that. So before this works on LabVIEW 64 Bit for 64 Bit Windows, all pointers and handles need to be revisited and changed to pointer sized integers, from the now unsigned 32 bit integer.

Rolf Kalbermatter
My Blog
0 Kudos
Message 13 of 14
(744 Views)

thanks again for your feedbacks.

 

the llb from rolfk brought me to the right way and i was able realise it!

 

happy christmas

0 Kudos
Message 14 of 14
(721 Views)