Jump to content

kiffab

Active Members
  • Posts

    72
  • Joined

  • Last visited

kiffab's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Thanks. Installed the drivers but unsure how to connect as you have an instance and a namespace within cache. No luck with this: $DSN = "DRIVER={CacheODBC};SERVER=IP:Port/Namespace;UID=Username;PWD=Password;"
  2. Hi Is it possible to connect to a Caché database using AutoIt? Using SQL, for instance, I could do this: $conn = ObjCreate( "ADODB.Connection" ) $DSN = "DRIVER={SQL Server};SERVER=mydbserver;DATABASE=mysqldb;UID=user;PWD=password;" $conn.Open($DSN) Cheers
  3. I can't upload these as they contain data, built in fields etc.However, when I add the code posted by jdelaney it is returning the name of the checkbox in the console. The template is a 'word 97-2003' template (probably 2003) but my PC is running word 2010 if that helps at all.
  4. Thanks water. I tried this but I can't see to get it to identify checkboxes within the file. I am reading .dot template files if that's a problem. However, it opens OK. Changed it slightly just to read a file first : #include <File.au3> #include <../_WordEx 1.3/WordEx.au3> Global $sDocument ; = "C:\AutoIT\Checkboxes\checkbox.dot" ; <=== Change path/name ; WdFieldType Enumeration. Specifies a Microsoft Office Word field. ; See: http://msdn.microsoft.com/en-us/library/bb213727%28v=office.12%29.aspx Global $wdFieldFormCheckBox = 71 ; FormCheckBox field ; WdContentControlType Enumeration. Indicates the type of content control. ; See: http://msdn.microsoft.com/en-us/library/ff197873%28v=office.14%29.aspx Global $wdContentControlCheckbox = 8 ; Specifies a checkbox content control $file = @SCRIPTDIR & "\smalltemplatelist.txt" FileOpen($file, 0); For $i = 1 to _FileCountLines($file) $line = FileReadLine($file, $i) $sDocument = $line Check() Next FileClose($file) Func Check() ; Create application object Global $oWord = _Word_Create() If @error <> 0 Then Exit MsgBox(16, "Word Example", "Error creating a new Word application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; Open document Global $oDoc = _Word_DocOpen($oWord, $sDocument) If @error <> 0 Then Exit MsgBox(16, "Word Example", "Error opening 'Test.doc'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) For $oContentControl In $oDoc.ContentControls If $oContentControl.Type = $wdContentControlCheckbox Then MsgBox(64, "Word Example", "Checkbox found!") ; $oContentControl.Delete(True) <== Delete the Control EndIf Next _Word_DocClose($oDoc) _Word_Quit($oWord) EndFunc
  5. I have 2010 but the templates are from 2000/2003. I can install any version required though.
  6. Simply know that they are present. If they exist I will write the name of the file to a text file or something. I have to remove these which I will get someone to do manually - just hoping to narrow it down to save them hunting through every template
  7. Hi water Thanks for that. Very useful. From this I can build a list of docs and open them. I see there's also a Find/Replace (find being important in my case). But how would I 'find' a checkbox? Thanks
  8. Hi Guys I have hundreds of word templates and need to loop through them checking each one for the existence of checkboxes. I have googled but not found anything useful. Is this possible? Any tips on how I can achieve it? Cheers
  9. fantastic, you guys have saved me hours =) thanks.
  10. Thanks for the quick response guys. Since I am getting a blank file I am clearly doing something wrong........ #include <Array.au3> #include <file.au3> $file = @SCRIPTDIR & "\textin.txt" $out = @SCRIPTDIR & "\out.txt" FileDelete($out) Dim $aRecords If Not _FileReadToArray($file, $aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] $char = StringRegExp($aRecords[$x], "([^\w\h\v]+)", 3) FileWriteLine($out, $char) Next
  11. Hi I'm trying to obtain a distinct list of special characters a particular field in my database. In SQL I am using the WHERE clause: LIKE '%[^0-9a-zA-Z ]%' What I need to do is loop through the results and grab only the special characters contained within so I can have a full list of the characters and send them to a supplier. Can anyone recommend a quick way to do this? I can export my SQL results to a text file so no requirement for database connectivity. An example could be \xxxxxx \xxx?xxx ^xxx^xxx Thanks
  12. Never tried it.... I will consult the documentation. I don't suppose it allows you to 'hide' things? i.e. run the app and do various IE stuff without actually displaying it on screen? Thanks
  13. Hi Guys I'm trying to automate activity on a website to run a report and add it to a database. I can do this but there are several flaws.... the main one being how slow this particular site is. It has multiple servers and the speed is just pot luck depending on how many users we have in. Here's what I'm doing so far. What I really need is something more robust like 'wait until xxx appears then............'. Any ideas? ; Winactivate function Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc ;Specify URL $url = "https://mysite.com" ; Open IE, browse to URL ShellExecute ( "C:\Program Files\Internet Explorer\iexplore.exe", $url ) ; Login _WinWaitActivate("My Site - Login - Windows Internet Explorer provided by my organisation","Address Combo Contro") Send("{SHIFTDOWN}username{TAB}password{ENTER}") ; Allow for slowness... Sleep(10000) ; Click _WinWaitActivate("My Site - Announcements - Windows Internet Explorer provided by my organisation","") MouseClick("left",107,521,1) ; More Slowness... Sleep(10000) ; click report and select option _WinWaitActivate("My Site- List - Windows Internet Explorer provided by my organisation","") MouseClick("left",400,211,1) MouseClick("left",400,270,1) ; Allow for more slowness Sleep(15000) ; Click the csv button MouseClick("left",334,225,1) _WinWaitActivate("Internet Explorer","Do you want to allow") Send("{TAB}{SPACE}") _WinWaitActivate("Message from webpage","Content has been cop") Send("{SPACE}")
  14. Thanks. I actually think I've broken Adobe trying this so I'll reinstall. Thanks for all your help guys =)
  15. Thanks. This looks useful. I can do it for a single print but it complains when trying to print via batch file. AcroRd32.exe /N /T "c:pdfpds1.pdf" myprinter AcroRd32.exe /N /T "c:pdfpdf2.pdf" myprinter c:program files.........acrord32.exe is not a valid win32 application.
×
×
  • Create New...