
Andy007
Active Members-
Posts
30 -
Joined
-
Last visited
About Andy007
- Birthday 01/01/1969
Profile Information
-
Location
Sydney, Australia
Andy007's Achievements

Seeker (1/7)
0
Reputation
-
Hi Melb23, Why would Aero be a problem?
-
Hi BewManNH, Thanks for responding. I am using an object oriented language called OpenROAD (by Ingres Corp)... Internally, each frame that is instantiated has its own "widgetid" and in the past this worked as the windows control id. eg: hwnd = curframe.widgetid;
-
Hi Melba, Could you please explain the problem with aero or please tell me what to type into the search to find out what are you talking about. I am always FEARFUL of posting in these forums, just in case someone flames me for putting in a dumb question. I have found this thread because I too am having problems with my Window (screen) capture program as a result of the latest AutoIt version (v3.3.8.1), it has changed the way _ScreenCapture_CaptureWnd works. Whether I have Aero on or off does not seem to matter. I am passing the window control ID from a different program (that part has not changed) but it looks like _ScreenCapture_CaptureWnd does not like the old controlID. So now, I get the entire desktop screen instead of just the window. Any help would be greatly appreciated. joelb, did you get any further?
-
Update the Excel UDF that comes with AutoIt
Andy007 replied to water's topic in AutoIt General Help and Support
Just wanted to say "Thank you Water and the other dudes" - I am very happy to see this course of action and I greatly appreciate your efforts. <loud applause> -
Hi All, I am a little stuck - I have written a word merge autoit program for a friend of mine. It use to run fine and then some Group Policies where applied to his machine. Now he gets the following error: The requested action with this object has failed. Runs ok as administrator but not as a normal user. The IT guys says, "if you can tell me which policy to change, then I will look into it"... (please imagine a gruff voice) Great help he was. The IT guy said it took him 3 days to setup the group policies. I know nothing of group policies but I would like to help my friend. ; ----------------------------------------------------------------------------- ; Name: mymerge ; Date: 16/05/2008 AP ; ----------------------------------------------------------------------------- #NoTrayIcon #include <Word.au3> #include <File.au3> Opt("MustDeclareVars", 1) Opt("ExpandEnvStrings", 1) global $param1, $param2, $param3 global $wd, $dc, $mm, $rng, $ver global $logfile = @DesktopDir & "\debug.log" $param1 = "WordMerge" $param2 = "C:\template.doc" $param3 = "C:\data.csv" _WordMerge() func _WordMerge() local $template = "" local $data = "" local $short_name = "" $template = $param2 _LogThis("Word template file: " & $template) if ($template = "") then _LogThis("No template file provided...") MsgBox(0, "Error", "Unable to proceed - missing word template file.") SetError(1) return endif if not FileExists($template) then MsgBox(0, "Error", "Template file does not exist. (" & $template & ")") SetError(1) return endif $data = $param3 _LogThis("Data file: " & $data) if ($data = "") then _LogThis("No data file provided...") MsgBox(0, "Error", "Unable to proceed - missing word data file.") SetError(1) return endif if not FileExists($data) then MsgBox(0, "Error", "Data file does not exist. (" & $data & ")") SetError(1) return endif _LogThis(" - opening template file: " & $template) $wd = _WordCreate($template,0,0) ; Start invisible. if @error then _LogThis(" - unable to open ms word...") MsgBox(0,"Error","Unable to start word...") SetError(1) _MyExit() endif $ver = $wd.version _LogThis(" - word version: " & $ver) ; $dc = _WordDocOpen ($wd, $template) $dc = _WordDocGetCollection ($wd, 0) $wd.DisplayAlerts = 0 _WordPropertySet ($wd, "visible", False) ; Mailmerge bits. _LogThis(" - processing merge...") $mm = $dc.MailMerge $mm.OpenDataSource ('"' & $data & '"', 0, true, true, true, false, "", "", false) $mm.Destination = 0 ; New document. $mm.execute ; Close template. _WordDocClose($dc,0) Sleep(100) ; Reset document to new document, then save to new file. $dc = _WordDocGetCollection ($wd, 0) $wd.ActiveWindow.ActivePane.View.Zoom.Percentage = 100 _WordPropertySet ($wd, "visible", True) $wd.DisplayAlerts = -1 Sleep(300) WinActivate("Form") _LogThis("Exiting...") exit endfunc ;==> _WordMerge func _LogThis($txt) local $sDateNow local $sTimeNow local $fh ; If Logging then... $sDateNow = @YEAR & "-" & @MON & "-" & @MDAY $sTimeNow = @HOUR & ":" & @MIN & ":" & @SEC $txt = $sDateNow & " " & $sTimeNow & " : " & $txt $fh = FileOpen($logfile, 1) if $fh = -1 then SetError(1) return 0 endif FileWriteLine($fh, $txt) FileClose($fh) return endfunc ;==> _LogThisSorry for my coding standards. Word does get started and hidden, then the error appears. Can anyone please help.
-
Open Windows Explorer with specific columns
Andy007 replied to sonofalion's topic in AutoIt General Help and Support
Bump -
Open Windows Explorer with specific columns
Andy007 replied to sonofalion's topic in AutoIt General Help and Support
Been over a year and I am still working on this. Opt("WinTitleMatchMode", 4) Opt("MustDeclareVars", 1) Opt("ExpandEnvStrings", 1) local $winpid = 0 local $handle local $open_dir = "" local $x = 0 local $y = 0 local $w = 0 local $h = 0 $open_dir = "c:\" ; Now launch Windows Explorer... $winpid = Run("Explorer.exe /e, " & $open_dir, "", @SW_SHOW) ; Get the handle of that window so it can be used in rezise... if @OSVersion = "WIN_XP" or @OSVersion = "WIN_2000" Then if WinWait("Classname=ExploreWClass", "", 45) = 0 then Exit $handle = WinGetHandle("Classname=CabinetWClass", "") else if WinWait("Classname=CabinetWClass", "", 45) = 0 then Exit $handle = WinGetHandle("Classname=CabinetWClass", "") endif ; Determine position and size... if @DesktopWidth > 1600 then $x = 250 $y = 80 $w = 1200 $h = 900 else $x = 100 $y = 50 $w = @DesktopWidth - ($x*2) $h = @DesktopHeight - ($y*2) endif ; Move and resize... WinMove($handle, $open_dir, $x, $y, $w, $h) Can now open Windows Explorer and make it the size I want. I would greatly appreciate any help on commands to set the View to Details and to unset Grouping (in Vista) if it happens to apply ITSELF again. Also if anyone can shed light on set the column sizes that would be an incredible. Thanks in advance. Any help with Windows 7 would also be appreciated... -
I think I have it working now. I had to re-install MS Office.
-
Hi All, I seem to have problem when I want to start a new instance of Word while another instance is already running. I have used: $wd = _WordCreate("",0,0,0) But when I load a document into $wd and then print it, I see the older document disappear for a few seconds and then come back again. Has anyone experienced this? Anyone have some ideas? Happens on Vista and XP. Thanks in advance.
-
Hi Kash, I add bmp files into word docs using the following: ... $bmp = _WordDocAddPicture ($oDoc, $my_bmp_filename, 0, 1) If Not @error Then $bmp.Range.InsertAfter (@CRLF & @CRLF) ...
-
Hi Klexen, Have you tried: $oWordApp = _WordCreate ("S:\IT\Jason\word.doc") To Print... The code here will show you how to get the default windows printer. (I prefer Martin's GetDefaultPrinter1 function) $num_of_copies = 1 $selected_layout = 0 ; 0=Portrait 1=Landscape $default_printer = GetDefaultPrinter1() _WordDocPrint ($oDoc, 0, $num_of_copies, $selected_layout, 1, $default_printer) - more details in the Word help file.
-
Hi Santana, Here is another alterative (sorry not the full prg but should help)... ... $wd = _WordCreate("",0,0,0) ; Start invisible. if @error then SplashOff() MsgBox(0,"Error","Unable to start word...") _MyExit() endif if $selected_layout = "0" then $wd.Activewindow.ActivePane.View.Zoom.Percentage = 85 else $wd.Activewindow.ActivePane.View.Zoom.Percentage = 75 endif ; Hide my program now... GUISetState(@SW_HIDE) $wd.DisplayAlerts = -1 $dc = _WordDocGetCollection ($wd, 0) $open_doc_count = @extended ; MsgBox(0, "Document Count", $open_doc_count) $dc.PageSetup.Orientation = $selected_layout; 0 = Portrait, 1 = Landscape $dc.PageSetup.TopMargin = _Convert_CmToPt(1.0) $dc.PageSetup.BottomMargin = _Convert_CmToPt(1.0) $dc.PageSetup.LeftMargin = _Convert_CmToPt(1.0) $dc.PageSetup.RightMargin = _Convert_CmToPt(1.0) Sleep(100) $bmp = _WordDocAddPicture ($dc, $prtscn_file, 0, 1) If Not @error Then $bmp.Range.InsertAfter (@CRLF & @CRLF) ...
-
Does anyone else have this problem, or am I alone... All alone. . .
-
Thanks Stefan, Did not work for me... I tried about 10 variations but no good. Any other ideas?
-
Hi All, I am finding my word merge program is caching my datasource and my autoit program is not overriding this cached value. Here is a few lines from my autoit program to reset the datasource: $mm = $wd.Activedocument.MailMerge $mm.OpenDataSource ('"' & $data & '"', 0, true, true, true, false, "", "", false) Where $wd is my word object and $data is my new csv data file. Any help would be greatly appreciated. Word2003/2007+WinXP/Vista