
August 9th, 2007, 11:20 AM
|
|
Contributing User
|
|
Join Date: Jun 2004
Posts: 190
  
Time spent in forums: 2 Days 7 h 16 m 13 sec
Reputation Power: 6
|
|
|
Clipboard content not available
Hi,
I have an application that would copy the contents from an IE's word component, open a word document and paste the copied contents into that opened document. The following is part of the code
vb Code:
Original
- vb Code |
|
|
|
Dim oWord As Object Dim oDoc As Object Clipboard.Clear AppActivate "C:\WINDOWS\test.htm - Microsoft Internet Explorer", True SendKeys "^a", True SendKeys "^c", True If Trim(Clipboard.GetText) = "" Then MsgBox "Content was not copied onto clipboard.Please set the focus onto the test html page and try again", vbOKOnly, "Copy contents" Exit Sub End If MsgBox Clipboard.GetText Set oWord = CreateObject("Word.Application") Set oDoc = oWord.Documents.Add MsgBox Clipboard.GetText oWord.Selection.Paste oWord.Visible = True MsgBox Clipboard.GetText 'oDoc.Activate oDoc.SaveAs FileName:="C:\test.doc" oDoc.Close Set oWord = Nothing Set oDoc = Nothing
When I am running this application, after the contents are copied to the clipboard, I am getting the text from clipboard in the alert. After the word object is invoked to open a new word document, the clipboard content is not present.
This works in few systems I don't come across this error. Is there any Dll that needs to be registered in the systems for the content to be available?
|