I do not know, that it is better: to create object "htmlfile" or " InternetExplorer. Application ". And can be all the same.
I reached up to clipboard through InternetExplorer. Application
; ! ***************************************************************************
;; ! copyToclipboard
;; ! ***************************************************************************
;; ! Function : Copy text to clipboard
;; ! Argument : 'str' - String
;; ! Returns : nil
;; ! ****************************************************************************
(defun copyToclipboard ( str / ieobj cbrd)
(setq ieobj (vlax-get-or-create-object
"InternetExplorer.Application"
)
)
(vlax-invoke ieobj 'navigate2 "about:blank")
(vlax-invoke
(setq cbrd (vlax-get (vlax-get (vlax-get ieobj 'document) 'parentwindow)
'clipboarddata
))
'setdata
"text"
str
)
(vlax-release-object ieobj)
)
; ! ***************************************************************************
;; ! Clearclipboard
;; ! ***************************************************************************
;; ! Function : Clear clipboard
;; ! Argument : nil
;; ! Returns : nil
;; ! ****************************************************************************;
(defun Clearclipboard ( / ieobj)
(setq ieobj (vlax-get-or-create-object
"InternetExplorer.Application"
)
)
(vlax-invoke ieobj 'navigate2 "about:blank")
(vlax-invoke
(vlax-get (vlax-get (vlax-get ieobj 'document) 'parentwindow)
'clipboarddata
)
'clearData
"text"
)
(vlax-release-object ieobj)
)
; ! ***************************************************************************
;; ! Getclipboard
;; ! ***************************************************************************
;; ! Function : Return text string from clipboard
;; ! Argument : nil
;; ! Returns : string
;; ! ****************************************************************************
(defun Getclipboard ( / ieobj str)
(setq ieobj (vlax-get-or-create-object
"InternetExplorer.Application"
)
)
(vlax-invoke ieobj 'navigate2 "about:blank")
(setq str(vlax-invoke
(vlax-get (vlax-get (vlax-get ieobj 'document) 'parentwindow)
'clipboarddata
)
'getData
"text"
))
(vlax-release-object ieobj)
str
)