Search the Community
Showing results for tags 'color text'.
-
Hi, I'd like to change different colors for different portion of text in same cell of Excel application. Neither character length nor cell might not fixed. Here's the code I've tried to put together but not manage to pull it off. I'm appreciate it for any suggestion, thank you. $oExcel = ObjCreate("Excel.Application") With $oExcel ; open new workbook .Visible = True .WorkBooks.Add .ActiveWorkbook.Sheets(1).Select() EndWith $oExcel.Cells.Font.Color = 0x000000 $oExcel.ActiveFont.Color = -16776961 Send ("'I'd like this sentence to be red'") Sleep(100) Send ("{AltDown}{Enter}{AltUp}") Sleep(100) $oExcel.ActiveCell.Selection.Font.Color = 0x000000 Send ("'I like this sentence to be black'") Sleep(100) Send ("{AltDown}{Enter}{AltUp}") Sleep(100) $oExcel.ActiveFont.Color = -16776961 Send ("'I'd like this sentence to be red again'") Sleep(100) Send ("{AltDown}{Enter}{AltUp}") Sleep(100) Send("{ENTER}")
-
My friends i would like to know how to change the text color that a user types in a TAEdit control.. I am trying to build a very simple text editor where a user has the option to change the text color or the bg color. Thank you in advance for any help. I search the forum about color change but nothing to use.. #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("I want to be a text editor", 663, 387, 200, 137) $MenuItem1 = GUICtrlCreateMenu("Options") $MenuItem2 = GUICtrlCreateMenuItem("Change text color", $MenuItem1) $MenuItem3 = GUICtrlCreateMenuItem("Change Bg color", $MenuItem1) $Edit1 = GUICtrlCreateEdit("", 8, 8, 625, 329) GUICtrlSetData(-1, "") GUICtrlSetColor(-1, 0xff0000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd