Forum: Ruby How to Use CTRL + C ie Copy to clipboard text from word file

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Talib H. (Guest)
on 2008-12-15 09:49
How to Use CTRL + C ie Copy to clipboard text from word file.
Talib H. (Guest)
on 2008-12-15 10:38
Talib H. wrote:
> How to Use CTRL + C ie Copy to clipboard text from word file.

Any one please
Heesob P. (Guest)
on 2008-12-15 11:12
(Received via mailing list)
2008/12/15 Talib H. <removed_email_address@domain.invalid>:
> How to Use CTRL + C ie Copy to clipboard text from word file.

require 'win32ole'
word = WIN32OLE.new('word.application')
file = 'c:/work/test.doc'
doc = word.documents.open(file,'ReadOnly' => true)
word.selection.wholestory  # select whole text
word.selection.copy          # copy to clipboard
word.activedocument.close(false)
word.quit

Regards,
Park H.
Talib H. (Guest)
on 2008-12-15 11:49
Heesob P. wrote:
> 2008/12/15 Talib H. <removed_email_address@domain.invalid>:
>> How to Use CTRL + C ie Copy to clipboard text from word file.
>
> require 'win32ole'
> word = WIN32OLE.new('word.application')
> file = 'c:/work/test.doc'
> doc = word.documents.open(file,'ReadOnly' => true)
> word.selection.wholestory  # select whole text
> word.selection.copy          # copy to clipboard
> word.activedocument.close(false)
> word.quit
>
> Regards,
> Park H.

Thanks dear,

Can I use something like the copied content on "word.selection.copy" as
"word.selection.paste"

please advise
This topic is locked and can not be replied to.