Squirrely1 Posted April 11, 2008 Share Posted April 11, 2008 (edited) qwert - I hope I didn't get you to unnecessarily install the beta - sorry, my bad - UDF's are indeed included in the latest release. It's getting the shortcut to the right help file that contains the help, that can be a small challenge. But if you already installed the beta, then after making your shortcut to the beta help file, do this to ensure you are using the release version:Start button > All Programs > AutoIt v3 > Beta > Toggle AU3 Beta(be sure you are using the release version here, because you might have to click on it a second time to toggle it back)Start button > All Programs > AutoIt v3 > SciTe > Switch-Definitions > 3.2.10.0 releaseIf DaleHolm's method won't work because you are attached to proportional fonts or whatever, here are some references:How to read a RichEdit controlAutoItPad - examples of using rich edit controlsIn the example in the help file under:AutoIt > Function Reference > GUI Reference > GUI Control Creation > GUICtrlCreateEditthere is a "RichEditExample()" function.How to convert a file from .rtf to .doc Edited April 11, 2008 by Squirrely1 Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
qwert Posted April 11, 2008 Author Share Posted April 11, 2008 qwert - I hope I didn't get you to unnecessarily install the betaNo -- I'm afraid I don't move that fast on these sorts of things.I do appreciate you following up with the information on RTF. I consider it to be worthwhile to learn about since I can probably put it to use for some other projects.Thanks for your help. Link to comment Share on other sites More sharing options...
DaveClark Posted June 9, 2008 Share Posted June 9, 2008 I have an text entry control defined as follows: GUICtrlCreateEdit("Test Field", 10, 10, 200, 160, $ES_WANTRETURN + $ES_MULTILINE + $ES_RIGHT) Every thing works fine and user entries are displayed as expected. Occasionally, however, I need to print the field. Right now, I'm simply writing the field to a text file and printing that file -- but it loses its right justification and prints left justified. Is there any feature to either 1) directly print the right justified edit field or 2) specify the justification when writing the text file? Building a blank-padded text file is the only technique I can think of, but that is difficult to do with proportional fonts. Hopefully, this has been "invented" -- but I've not been able to locate a solution. Thanks for any assistance. The easiest way I have found is to use padding with spaces, then open notepad and using Send commands set the Font to Courier New and then copy & paste in your right justified text columns. I have done this with a amortization schedule. You can automate the printing process using Notepad or let the user use File/Print or Control-P. Here are two functions I made to simplify text alignment and column width. Using these, you can build a string with right justified columns to copy and paste into notepad using autoit commands. Func RSet ($Str, $Width) Return _StringRepeat(" ", $Width - StringLen($Str)) & $Str EndFunc Func LSet($Str, $Width) Return $Str & _StringRepeat(" ", $Width - StringLen($Str)) EndFunc Here's the commands I use to select Courier New font and copy and paste your text into Notepad. If you try to use the Send command instead of Copy & Paste, it is really slow! Run("Notepad.exe") WinWaitActive("Untitled - Notepad") Send("!FO") Send("Courier New") Send("{TAB}{TAB}{TAB}{TAB}") Send("{ENTER}") _ClipBoard_SetData ($Txt2Prnt) ;Copy to Clipboard Send("^v") ;Control V (Paste) Hope this helps. TopRock Link to comment Share on other sites More sharing options...
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