Animatronic Posted 23 hours ago Posted 23 hours ago Hello, please tell me what could be the problem when reading data from ComboBox to the family location from GUICtrlSetData, it always returns the number 7. I have already tried all the functions, they all give the number 7, I can't figure out what the problem is: Global $Form1 = GUICreate("Оформление заявки на топливозаправщик", 435, 438, 301, 154) $Combo1 = GUICtrlCreateCombo("Водитель", 232, 248, 185, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($Combo1,"Ефименко|Финк") Local $tInfo,$Combo1 GUISetState(@SW_SHOW) $oWord = _Word_Create(True,False) $oDocTemp=_Word_DocOpen($oWord, @ScriptDir&'\Документ Microsoft Word (2).docx') ; WinActivate("Документ Microsoft Word (2).docx - Word") Sleep(500) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Combo1 If _GUICtrlComboBox_GetComboBoxInfo($Combo1,$tInfo) Then _Word_DocFindReplace($oDocTemp, "111",$Combo1) EndIf EndSwitch WEnd
Developers Jos Posted 19 hours ago Developers Posted 19 hours ago (edited) What with these quoted posts without any extra info? Just be patient in case this is your way of bumping the thread and stop doing it. (Redundant posts removed) Edited 19 hours ago by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Animatronic Posted 16 hours ago Author Posted 16 hours ago 2 hours ago, Jos said: What with these quoted posts without any extra info? Just be patient in case this is your way of bumping the thread and stop doing it. (Redundant posts removed) Sorry for that I'm not American I was just trying to edit my original post but my English isn't very good so I messed up and couldn't delete it.
Nine Posted 16 hours ago Posted 16 hours ago (edited) Welcome. So here a few hints that you should consider before asking for help : 1- When you post code, use the method shown in the link 2- Translate your code into english so we can more easily understand the goal of the script 3- Indent your code properly to make it readable (use tidy : Ctrl+t) 4- Make sure that the script is runnable by itself, in your case all the #include were missing 5- When your code contains references to file (.docx in your case), add an example of the files in your post The problem in your code is that line : _Word_DocFindReplace($oDocTemp, "111",$Combo1) You should modify it like this : _Word_DocFindReplace($oDocTemp, "111", GUICtrlRead($Combo1)) ps. you have declared $Combo1 after its usage, not a good idea. Always use this line after the #include, it will save you lot of bugs easily detectible with it : Opt("MustDeclareVars", True) Edited 14 hours ago by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
Developers Jos Posted 14 hours ago Developers Posted 14 hours ago 2 hours ago, Animatronic said: Sorry for that I'm not American Me neither!😉 You can't edit or delete posts until you have a certain group status. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Animatronic Posted 8 hours ago Author Posted 8 hours ago 7 hours ago, Nine said: Welcome. So here a few hints that you should consider before asking for help : 1- When you post code, use the method shown in the link 2- Translate your code into english so we can more easily understand the goal of the script 3- Indent your code properly to make it readable (use tidy : Ctrl+t) 4- Make sure that the script is runnable by itself, in your case all the #include were missing 5- When your code contains references to file (.docx in your case), add an example of the files in your post The problem in your code is that line : _Word_DocFindReplace($oDocTemp, "111",$Combo1) You should modify it like this : _Word_DocFindReplace($oDocTemp, "111", GUICtrlRead($Combo1)) ps. you have declared $Combo1 after its usage, not a good idea. Always use this line after the #include, it will save you lot of bugs easily detectible with it : Opt("MustDeclareVars", True) Thank you, you helped a lot!
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