anks Posted October 20, 2010 Posted October 20, 2010 Hi All, I am facing a issue where i have to Get the text from an application, and paste that text in the clipboard. The text copied to clipboard should be in the same format as that of the application. For ex: if Application font is Verdana, the text getting saved should have verdana font. Please look the snippet of code written by me: #Include <ExcelBMS.au3> #Include <BMS.au3> #Include <Clipboard.au3> $text = ControlGettext("Building Management System - Engineering", "", "[NAME:label1]") msgbox(0,"",$text) $ret = _ClipBoard_SetData($text,$CF_TEXT) msgbox(0,"",$ret) I am able to save the text on clipboard but the font is not getting saved in the same format. Any body who know regarding this please help me.... Thank you.!! ~Ankita
jaberwacky Posted October 20, 2010 Posted October 20, 2010 Try this and report back: #include <ExcelBMS.au3> #include <BMS.au3> #include <Clipboard.au3> _ClipBoard_RegisterFormat("Rich Text Format") $text = ControlGetText("Building Management System - Engineering", "", "[NAME:label1]") MsgBox(0, "", $text) $ret = _ClipBoard_SetData($text, $CF_TEXT) MsgBox(0, "", $ret) Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
anks Posted October 20, 2010 Author Posted October 20, 2010 Try this and report back: #include <ExcelBMS.au3> #include <BMS.au3> #include <Clipboard.au3> _ClipBoard_RegisterFormat("Rich Text Format") $text = ControlGetText("Building Management System - Engineering", "", "[NAME:label1]") MsgBox(0, "", $text) $ret = _ClipBoard_SetData($text, $CF_TEXT) MsgBox(0, "", $ret) Thanks for the reply I tried your above code, but i am not able to save the type and size of the font on the clipboard. My objective is to get the text from an Application and paste the text with same size and type into excel. Please reply me ...if you have any idea.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now