Search the Community
Showing results for tags 'formatting'.
-
Yesterday I had to make some little changes to an old Autoit program we use at my work. The program reads some data and convert it to Excel. Before writing the cell, it is changed to text and later on I slap the column with an autofitwidth. Furthermore weI execute a conditional format on the sheet, to make the data more readable. I quickly found out that because of the breaking changes Excel.udf had starting from AutoIt 3.3.12.0, a lot of things had to been changed. The changes I had to do, only took 10 minutes. After trying to adjust the script for over 5 hours, to get it working with the new Excel.udf, I gave up. I stopped changing the script, uninstalled the my Autoit and went looking for an older version. Luckilly I was able to find Autoit v3.3.8.1 (with corresponding Scite) in my software repository. Installing Autoit V3.3.8.1 and compiling the file, now took me 10 minutes . So why did I not get the old script working with the new Excel.udf? There are several reasons I failed getting the old script working with the new Excel UDF. I had some pressure from management to fix it ASAP (and got a little anxious) Most all resources on the internet point to the working of the old EXcel.UDF And offcourse there were thosing "breaking changes", with new functions using diffrent parameters or using parameters in different order. One of the column's on the sheet is used to store EAN13 (barcode) and was formatted like 1,23E12. I couldn't change the cell to text, also autofitwidt was not working and using conditional formatting was also a no-no. So in the end I could use the new Excel UDF, but not desapointed management. What would I like to ask? I understand that sometimes you want to rewrite a program to make it better. I even understand that one has to make breaking changes sometimes. But in this case because of lacking examples/resources my day went completely down the drain. I would like to ask the Excel.udf developpers to: Make more functions available to do things like changing cell properties easily, changing cell color, do an autofit columnwidth, format data conditionally. Or write an Example using the (new) Excel UDF, making examples how to format a cell, do conditional format, changing cell colors etc. I probably am more of an example guy. Having a good Excel.UDF Example showing a lot of common things normally makes, programming things easy for me. Because I can keep tweaking snippets until I get it working the way I want it. So dear developpers, could you help me and other future user out?
- 12 replies
-
- excel
- formatting
-
(and 1 more)
Tagged with:
-
I've failed to find an example of _Word_DocFindReplace which searches for formatted text (I'm looking for stand alone paragraph marks that are formatted other than normal i.e. Bold Italic, Underlined). The reason being that when converting a Word document to html one of the main problems in the results is that a stand alone paragraph mark is converted to an html space that retains the formatting ...> <... thus showing up as a underline _ in a browser when it should be blank. I've played around with the script and got it to at least un-bold the first paragraph mark regardless if it was bold or not but I'd like to clear all formatting from any stand alone paragraph marks in the whole document. Below is what I've done so far (not much more than in the help file I'm afraid) . Way down at the bottom of the _Word_DocFindReplace help text is this parameter but without any examples to be found : $bFormat [optional] True to have the find operation locate formatting in addition to or instead of the find text (default = False) #include <MsgBoxConstants.au3> #include <Word.au3> $processing = @MyDocumentsDir & '\AutoIt_code\getter\processing\' Global $oWord = _Word_Create() Global $sTestfile = $processing & "Testing.docx" ConsoleWrite($sTestfile & @CRLF) Global $oDoc = _Word_DocOpen($oWord, $sTestfile) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "ERROR", "Error opening file = '" & $sTestfile & "'" & @CRLF & "@error = " & @error & ", @extended = " & @extended) $oRangeFound = _Word_DocFind($oDoc, "^p", Default, Default) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocFind Example", _ "Error locating paragraph control character in the document." & @CRLF & "@error = " & @error & ", @extended = " & @extended) $oRangeFound.Bold = False If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocFind Example", _ "Error inserting text after the paragraph control character in the document." & @CRLF & "@error = " & @error & _ ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocFind Example", "Paragraph control character successfully replaced." & @CRLF & _ "Text inserted in paragraph 2.")
-
Evening, I've been copying a lot of text from PDF files and other documents. Problem is, this text appears badly mangled when pasted again, causing formatting issues. I've been trying to write a script that would automatically reformat the copied string: #include #include #NoTrayIcon Opt("TrayMenuMode", 1) $AboutTrayItem = TrayCreateItem("About") TrayCreateItem("") $ExitTrayItem = TrayCreateItem("Exit") TraySetState() $hDLL = DllOpen("user32.dll") Beep(1100,300) While 1 While _IsPressed("11",$hDLL) If _IsPressed("43",$hDLL) Then ClipPut(StringStripWS(StringReplace(StringReplace(_ClipBoard_GetData(),@lf," "),@cr," "),4)) Beep(1300,150) While _IsPressed("43",$hDLL) Sleep(250) WEnd EndIf WEnd Local $msg = TrayGetMsg() Select Case $msg = $AboutTrayItem MsgBox(64, "About", "When CTRL+C is pressed, a reformatted version of the string that has thereby been copied, without any newline characters, should be placed on the clipboard.") Case $msg = $ExitTrayItem ExitLoop EndSelect WEnd DllClose($hDLL) Beep(600,300) So far, it's working for some of my sources. Others, like this two-column book, I still can't nicely copy from. How do I get out all line breaks, newlines, carriage returns etc. out of a string? Thanks in advance!
- 2 replies
-
- string
- formatting
- (and 6 more)
-
Hello, When I want to post some code to the forum, I always have some issues on how to paste it correctly so the code looks correct in my post. The problems I ran into are: - the tab indent disapear - some smileys appear with some regexp patterns - the forum try to auto format the text and add some html tags in my regexp patterns - paste the code in "toggle edit mode" to keep the tab indents but this method adds some html tags here and there - I don't know about you guys, but when I try to paste some code in the "Special BB code" and select "Autoit" then the window stretches up and I cannot click the button to validate (the button goes out of my screen (Google Chrome and Windows 7 x64))! I tried several ways and it seems that the best way of doing it is: 1 - Paste the code as plain text (to make sure no text formatting is kept) 2 - write myself the [ autoit ] tags at the beginning and end of the code 3 - now the problem is that this method doesn't keep the tab indents. I was thinking that there should be a tutorial pinned in every forum, because I've seen that I am not the only one having troubles with it. So if you have some tips, I'd be happy to know them so I don't pull my hairs every time! jmon. [EDIT] Solved: So it's a problem with the IPB forum editor, so while there is no update, the best way of doing it is (From Melba23 and BogQ): 1 - Toggle "Edit mode" (Top left of the text editor) 2 - do all you things in edit mode 3 - add manually the autoit tags for autoit code ([*autoit*] for the beginning, [*/autoit*] for the end (remove the stars)) 4 - preview your post. If there is unwanted html tags, then remove them manually 5 - post This method keeps the TAB indents, but sometimes add some unwanted html tags in RegExp Patterns and URLs. Also sometimes, #includes containing "<" or ">" will disappear. In this case, preview your post and if you notice this then just write them again...