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

H

Heesob Park

2008/12/15 Talib Hussain said:
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 Heesob
 
T

Talib Hussain

Heesob said:
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 Heesob

Thanks dear,

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

please advise
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top