IQ9003
Active Members-
Posts
28 -
Joined
-
Last visited
Profile Information
-
Location
Netherlands
IQ9003's Achievements
Seeker (1/7)
0
Reputation
-
Hi, Here is a small piece of code which I use. (Tested with outlook 2003, with the proper permissions to read the other mailbox!) This code saves an attachement in a mail from a different mailbox (it only saves attachements with the name brief.doc) #Include <Array.au3> #Include <File.au3> local $teller ;$teller=Opslaanbijlagen("Caixa de correios - Cadastro Credito - VC\Inbox", "c:\temp") $teller=Opslaanbijlagen("Postvak - Name\Postvak IN\Test", "c:\temp\") ;=============================================================================== ; ; Function Name: Opslaanbijlagen ; Description: Opslaan van alle bijlagen die aan de criteria voldoen ; Syntax.........: Opslaanbijlagen("Postvak - Mijnaam\test\subtest","C:\temp" ) ; Requirement(s): AutoIt3 with COM support (post 3.1.1) ; Return Value(s): Not used in this example ; ; Author(s): Iq9003 ; Created: 08072009 ; Modified: ; ;=============================================================================== Func Opslaanbijlagen($Postbus_user, $tempdir) $oOApp = ObjCreate("Outlook.Application") $myNamespace =$oOApp.GetNamespace("MAPI") ; Original folder $myarrayold=StringSplit ( $Postbus_user, "\") $myOldFolder = $myNamespace.Folders($myarrayold[1]) For $i=2 to $myarrayold[0] $myOldFolder=$myOldFolder.Folders($myarrayold[$i]) next For $a=$myOldFolder.Items.count to 1 Step -1 $teller=$teller+1 $iAttachCnt = $myOldFolder.Items($a).Attachments.Count If $iAttachCnt > 0 Then For $iAttachNum = 1 to $iAttachCnt $oTemp = $myOldFolder.Items($a).Attachments.Item($iAttachNum) $sFileName = $oTemp.FileName $oTemp = $myOldFolder.Items($a).Attachments.Item($iAttachNum) if stringinstr($sFileName,".doc") > 0 and stringinstr($sFileName,"Brief") > 0 then $oTemp.SaveAsFile ($tempdir & $teller & $sFileName ) endif Next EndIf next return $teller endfunc
-
Silent PDF print in Adobe Reader 9.1
IQ9003 replied to JeffL's topic in AutoIt General Help and Support
I've also created a script to print PDF's from a mailbox. (I wasn't able to create a full silent print). But I came up with the following: ShellExecuteWait ("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe" ,"/t " & $tempdir & $file & " " & $PrinterName, @SW_MINIMIZE) WinWait($file,"") Winwait("Adobe Reader") When Acrobat Reader prints the file (commandline switch: "/t") the windowtitle of adobe Reader changes to the filename, when the print is completed/queued it changes back to "Adobe Reader". At that point it's safe to continue you're code. (I use winkill to close de AcroRd32.exe) -
How to start a Unix script with AutoIt (from Windows)
IQ9003 replied to Bram's topic in AutoIt General Help and Support
Hi, You could use reflection to build basic-scripts. Where you let an autoit script start a reflection session and start a reflectionbasic script (via commandline). And perhaps there's more information for using a telnet session with autoit. -
Getcontroltext with ClassNN or coords
IQ9003 replied to IQ9003's topic in AutoIt General Help and Support
It turns out its not a bug....well not exactly anyway. When I use the InfoTool, it gives me a position of a control (the correct position compared to an older autoIt version). Because I couldn't find any controls on my previously programmed location I made a small testscript: Dim $Array1[50][50] For $X=1 to 49 ;x for $Y= 1 to 49 ;y $array1[$X][$Y]= ControlGetText("ANVA Test", "","[X:" & $X+150 & ";Y:" & $Y+300 & "]") next next _ArrayDisplay($array1) With this I scanned an area of the screen (application). This gave me the result I wanted but there's a 27 difference in what the Infotools shows and my testscript. So I can get it to work, but I ca'nt explain the difference in coordinates. -
There's a good outlook UDF on this forum, it helped me a lot. ....at least its a start. OutlookUDF
-
Well, perhaps this could be of use to you (It gets the currentusers adress, so you don't have to specify the account. $oOApp = ObjCreate("Outlook.Application") $myNamespace =$oOApp.GetNamespace("MAPI") $myfolder=$myNamespace.CurrentUser.Address
-
Hi, In the attached screenshot you can see what I mean. In this example Postvak Iq9003=Postvak gebruiker. postvak_iq.bmp
-
Hello, I'm not sure this helps you (I'm not exactly sure what you meant) But perhaps this could help you. It retreives the currentusers mailadress (the user must be logged in) In this example I used a hardcoded mailbox, but maybe it can be done with defaultfolder. $oOApp = ObjCreate("Outlook.Application") $myNamespace =$oOApp.GetNamespace("MAPI") $myfolder=$myNamespace.Folders("Postvak Gebruiker").folders.session.currentuser.address
-
With help from Malkey I was able to read text from a button with controlGetText($MAIN_WINDOW_TITLE, "", "[X:7\;Y:2\]") But now I've stumbled upon a new problem. Although the code works for reading text from the toolbar in the application I use it does not read statics or editbox's. But using: ControlGetText($MAIN_WINDOW_TITLE, "", "Static1") does give me the result. Whereas using it with the coordinates of this static I don't get a result. I first thought it had to to with the application because the window is AcucobolWClass, but since I do get a result with calling Static1 I'm not so sure. My guess its a bug...can anyone confirm or deny that?
-
Thanx, I've tried ControlGetText($MAIN_WINDOW_TITLE, "", "[X:7\;Y:2\]") and it works. But now I've got another problem. The code works, however i'm not able to read a static or an editbox. Ill's start a new topic for this problem
-
Here's some more info: The program we're using enables users to make custom screens inside the application. When a new screen is made and an editbox is added it gets edit1 as an id, the second gets edit2. Therefore I need to use the coordinates. While the Function in the old AutoIt works in the newer it doesn't. Here's the info I got with the AU3Info-tool: (Two different screens but the editbox is used for the same info)
-
Hello, The control ID doesn't work for me. The application i'm using has various screens (100+) in wich the editbox that I want to read is always on the same coords, but doesn't have the same controlID. The old au3lib function gives me result, but the new function gives me an errorcode1. (The au3info also shows the right info)
-
I'm having trouble using the ControlGetText function. In the old AutoITV3 (with the Au3Lib) I used this function: _ControlGetControlText($MAIN_WINDOW_TITLE, "", $RELATIE_LABEL_RELNR_X, $RELATIE_LABEL_RELNR_Y) Now I'm trying to translate this to the newer version of AutoIT and I use this: ControlGetText($MAIN_WINDOW_TITLE, "", "[X:8; Y:133; W:119; H:18]") But this doesn't work, it doesn't find the controls value (it's an editbox : Edit1). The program has different pages, and the editboxname isn't always the same (The position is always the same). The following code does work, but because Edit1 can change to Edit2 I need to get the text from the position: ControlGetText($MAIN_WINDOW_TITLE,"","Edit1") What am I doing wrong? (and how can I do it better?
-
yes it also works for folders at the same level as the Inbox, but also to other users mailbox. (We also have Outlook2003)
-
Hello, I've made some progress on my own script in which I've managed to move a mail form mailbox1 to mailbox2 (including the subfolders I asked about). With the code you made and some googl'ing I was able to construct the following code: $teller=SaveAndMove("Mailbox User1\Inbox","Mailbox User2\Inbox\test") msgbox(0,"Mail moved","I've moved " & $teller & " mail Items") Func SaveAndMove($Postbus_old, $Postbus_new) $oOApp = ObjCreate("Outlook.Application") $myNamespace =$oOApp.GetNamespace("MAPI") ; Original folder $myarrayold=StringSplit ( $Postbus_old, "\") $myOldFolder = $myNamespace.Folders($myarrayold[1]) For $i=2 to $myarrayold[0] $myOldFolder=$myOldFolder.Folders($myarrayold[$i]) next ; Folder to put the mail in $myarraynew=StringSplit ( $Postbus_new, "\") $myNewFolder = $myNamespace.Folders($myarraynew[1]) For $i=2 to $myarraynew[0] $myNewFolder=$myNewFolder.Folders($myarraynew[$i]) next $teller=0 ;Countback loop, this is because the mailitem index resets after each move For $a=$myOldFolder.Items.count to 1 Step -1 If $myOldFolder.Items($a).flagicon=3 then $teller=$teller+1 $iAttachCnt = $myOldFolder.Items($a).Attachments.Count If $iAttachCnt > 0 Then For $iAttachNum = 1 to $iAttachCnt $oTemp = $myOldFolder.Items($a).Attachments.Item($iAttachNum) $sFileName = $oTemp.FileName $oTemp = $myOldFolder.Items($a).Attachments.Item($iAttachNum) if stringinstr($sFileName,".pdf") > 0 then $oTemp.SaveAsFile ("c:\temp\" & $sFileName) endif Next EndIf ;Move mail after saving attachements $myoldfolder.Items($a).move ($myNewFolder) endif next return $teller endfunc