5 posts in this topic
First, I want to give a huge shout-out to the community. I'm completely self-taught, and have never had to actually ask a question before because the forum is that good at answering questions and explaining things. However, I'm kind of stumped here, and I've been stuck on this problem for almost a full day.
I'm working on a script to populate drafts of deeds at work. I have the main GUI and a function (ctrl($n) and read()) for adding fields to find and data to replace it with to an array for later use with _word_docfindreplace. All of that works. However, due to the way I have the forms set up, I need to create additional fields and info based on the data that's there. Specifically, if there's only one buyer, I need to add the field [Buyer1&2] and the data in $aArray_Base for [Buyer 1]. I also need to add a field [Buyer 2] and have a blank data set in the next column over in the array, and I need to do the same for the Seller. To this end, the function parties() sets boolean variables $2buyers and $2sellers accordingly. Then, I have buyers() and sellers() to populate the data.
The problem that I'm running into is that each function works... when ONLY the buyer 1 name field is filled, and when ONLY the seller 1 field is filled.
So if I fill Buyer 1 Name and save it, the data is populated correctly. But when I fill Buyer 1 and Seller 1 name, only the buyer 1 data populates correctly. Worse, when I fill several fields, neither populate correctly. I have no idea why this happens. I've added messageboxes to debug throughout the entire process and can't pinpoint what's causing the issue. The entire script is below. The function(s) in question are buyers() and sellers(). Only Sellers() has messageboxes throughout.
Can someone help walk me through what might be causing this and help me find a solution? Thanks a ton in advance, and sorry for the wall of text.
As near as I can ascertain using the Word UDF the paragraph count does not count the numbered paragraphs in a document but counts something like all paragraphs (numbered , un-numbered, indented) minus empty lines. Is there any easy way of getting the first level numbered paragraph numbers? You'll see in my test document there are just 7 numbered paragraphs.
#include <Word.au3> #include <Array.au3> Local $oWord = _Word_Create() Local $sDocument = @MyDocumentsDir & "\test.docx" Local $oDoc = _Word_DocOpen($oWord, $sDocument, Default, Default, True) $oRange = $oDoc.Range $sText = $oRange.Text $aLines = StringSplit($sText, @CR) _ArrayDisplay($aLines) $wdPropertyParas = 24 $sParas = $oDoc.BuiltInDocumentProperties($wdPropertyParas).Value $sParas = $sParas ConsoleWrite($sParas & @CRLF)
Good morning everyone
I was talking about this UDF in this thread, but for not confusing "arguments", I opened a new thread...
So, the issue I'm having, is the format of the table, that you can see in the image above... Can you help me out please? Thanks
Text of the previous post:
Local $oWord = _Word_Create(False) If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante la creazione dell'oggetto Word." & @CRLF & "Errore: " & @error) Else ; The field alreay exists, but would be nice if I can create it... I thought at _FileCreate() :) Local $oDoc = _Word_DocOpen($oWord, $sCartellaModelli & "\Esportazione_Modello.doc") If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante l'aggiunta di un nuovo documento Word." & "Errore: " & @error) Else Local $oRange = _Word_DocRangeSet($oWord, 0) If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante il settaggio del range nel documento Word." & @CRLF & "Errore: " & @error) Else _Word_DocTableWrite($oRange, $aListView, Default) If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante la creazione della tabella." & @CRLF & "Errore: " & @error & "Informazioni: " & @extended) Else _Word_DocSaveAs($oDoc, $sCartellaEsportazioni & "\Esportazione_di_prova.doc") EndIf EndIf EndIf EndIf And this is the actual result:
First of all, I want to apologize with @Melba23, @JLogan3o13, and @Jos ( I don't know why the tag sometimes works and sometimes doesn't ), for my bad attitude I have had with
them. I want to explain why I was so angry, but that's not an excuse to my bad attitude...
I have health problem, and lastly, I am ever more angry because I'm fighting with these problems for 5 years and I feel worse than 5 years ago, even If I had a lot of investigations about with a lot of Doctors, and there's no cure for my pathology. I don't want to touch anyone with my "story", but I wanted to explain why, sometimes, you can feel my anger in my words.
I promise I'll try to be as polite as my mom taught me, and to explain all I'd like to develop, posting all you need ( sample codes... ).
Now, let's talk about my project.
Let's start from 0!
I'd like to implement a database with AutoIt, for the warehouse management.
First of all, I'd like to set some "goals" which I want to respect, developing my application:
What's the best way to develop a database with AutoIt? With a .txt file? With an Excel workbook?
I was working on Excel workbook, but, I don't know, I could always be wrong in terms of efficiency and "easy to make changes"; I have to create a GUI, in order to let the user do things ( I think it was quite obvious ), so, I have been always used GUI functions like GUICreate and so on; anything about _GDI_Plus or something else. Most, I used _GUI* functions. What's the best way to manage different GUIs? OnEvent Mode or Message Loop "mode"? Now, I'd like to make a list of what I'd like my application would do:
Reading stocks: I manage mainly 2 manufacturers, so, If I will work with an Excel workbook, I'd prefer to divide first manufacturer with the second; Add product: Simply, If a product does exist, the application prompt to the user an input box, with a sort of summary ( Product name, quantity ) of the product he's adding; ELSE, if the product does not exist, an "Add New Product" GUI should appers; Withdraw product: As a warehouse, I need to add and to withdraw product... This "function" should performs the simply task of reserach the product based on his ID and, prompt an InputBox to the user, with a little summary of the product he's withdrawing and, the quantity of the product after the withdraw; Search product: I'd like to develop a "product reserach", based on the ID of the product(s), or based on the Description of the product(s)... It'd be very nice! Create DDT: Create a DDT with a pre-formatted Excel sheet. Just insert some information, and then all the products that have been withdrawn from the database ( maximum 14 per DDT ); I have already done some of work I described here, and you can find all files you need attached to this post.
I don't want you to do this. Just, don't post your code that I have been looking for, but let me try, with your help, to get an appropriate and efficient solution to what I'm asking.
The last, but not the less important, the recognition I can give to you is publish your name ( or alias ) on the "developer section", more than a donation for everyone who has take part to this project.
Please, if you want to know further information ( I think I've been exhaustive enough ), write here or on a PM.
Another time, a big thank you to this fantastic community and, a bigger one, to the developers of this amazing and powerful programming language.
Enjoy your night.
PS: I will post the code tomorrow ( the most updated code ), so you can see where I have been arrived and, nothing Warehouse_Management.xlsx
I've lurked around here for a while and learned a ton from everyone, but I can't see this issue anywhere. I've been running macros through Autoit for a while in a number of programs, but I'm having some issues with this one.
Func RunMacro() Local $oExcel = _Excel_Open(False, False, False, False) ;Excel Program Local $oWorkbook = _Excel_BookOpen($oExcel, "C:/Equity Helper/Scripts/calendarmacros.xlsm", Default, Default, True) $oExcel.Run("calendarmacros.xlsm!Calendar") EndFunc When I run this bit of code everything works fine as long as the macro gets to finish. But the actual VBA calls two "Application.UserInput" fields, and if I cancel out of either the macro closes, and then AutoIt throws an error at--
$oExcel.(<---error throws here)Run("calendarmacros.xlsm!Calendar") I don't want to use autoit for the user inputs if possible, it's just easier to get the data I need for the inputs from within the VBA environment, but I'm afraid that's what's causing the problem.