Jump to content

idahoguy4life

Members
  • Posts

    14
  • Joined

  • Last visited

idahoguy4life's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I figured it out! You got me thinking it must not be the right class...so I commented out If $oItem.Class <> $iObjectClass Then ContinueLoop and my array returned the items. Then I simply requested it write what $oItem.Class was and discovered the items in the folder were being stored as $olPost ! Changing my script to below showed my array properly: #include "OutlookEX.au3" #include <Array.au3> $oOutlook = _OL_Open() ConsoleWrite("_OL_Open: " & @error & @LF) $Local_Folder = _OL_FolderAccess($oOutlook, "Path\To\Public\Folder") ConsoleWrite("_OL_FolderAccess: " & @error & @extended & @LF) $listofmail = _OL_ItemFind($oOutlook, $Local_Folder[1], $olPost, "", "", "", "UnRead,EntryID") ConsoleWrite("_OL_ItemFind: " & @error & @LF) _ArrayDisplay($listofmail) Thank you so much for helping me dig through this. You are a genius The rest should be simple enough :-S
  2. I still get this in the console: _OL_Open: 0 _OL_FolderAccess: 00 _OL_ItemFind: 0 If I put the msgbox where you said to, no message appears. It is not dropping into the else statement as we don't appear to have any restrictions set. ? The below script returns the message box with the correct number of items in the folder: If StringStripWS($sRestrict, 3) = "" Then $oItems = $vFolder.Items msgBox(0,"",$oItems.Count) Else $oItems = $vFolder.Items.Restrict($sRestrict) EndIf
  3. Ya, it is an interesting situation where it can count the items in the folder correctly but it doesn't return the individual items... Thanks again for the help.
  4. _OL_Open: 0 _OL_FolderAccess: 00 _OL_ItemFind: 0 Array: 0 | 2
  5. It shows it is unread in Outlook $listofmail = _OL_ItemFind($oOutlook, $Local_Folder[1], $olMail, "[unRead]=True", "", "", "UnRead,EntryID,SenderEmailAddress,Subject,Body", "", 4) Returns 1 as well
  6. Sorry: _OL_Open: 0 _OL_FolderAccess: 00 _OL_ItemFind: 0 # of records: 1 (There is 1 mail item in the folder right now)
  7. _OL_Open: 0 _OL_FolderAccess: 00 _OL_ItemFind: 0
  8. Column 0 | 1 0 | 5 So that is a false...
  9. Right, There are no errors thrown with accessing the folder. It is just not finding any of the content items. But they are displayed with _OL_ItemDisplay($oOutlook, $Local_Folder[1]) so the path has to be right...
  10. @error is 0 Also, something else I just recognized. It is not asking for permission to run the script in outlook like it normally does. If I replace the public/folder/path with $Local_Folder = _OL_FolderAccess($oOutlook, "\subfolder", $olFolderInbox)Outlook asks for permission to run the script and correctly reads the items in the folder I attempted to run _OL_FolderAccess with the enumerator $olPublicFoldersAllPublicFolders: $Local_Folder = _OL_FolderAccess($oOutlook, "\Path\to\public\folder", $olPublicFoldersAllPublicFolders) 1. It doesn't recognize the variable $olPublicFoldersAllPublicFolders 2. When I define the variable with $olPublicFoldersAllPublicFolders = 18 it shows the array (with nothing in it) and it opens the public folder correctly but then gives me this in the console: [size=4]_OL_FolderAccess: 00[/size] COM Error Encountered in file.au3 OutlookEx UDF version = 0.9.0 @AutoItVersion = 3.3.6.1 @AutoItX64 = 0 @Compiled = 0 @OSArch = X86 @OSVersion = WIN_XP Scriptline = 2514 NumberHex = 80020006 Number = -2147352570 WinDescription = Unknown name. Description = Source = HelpFile = HelpContext = LastDllError = 0 Thanks for your help trying to figure this out!
  11. If it helps this is an example of what I was using in VB Script that worked: Set allItemsFolder = GetFolder("Path\To\Messages") Set objFolder = GetFolder("Path\To\Calendar") Set sentFolder = GetFolder("Move\Messages\Here\After\Adding\To\Calendar") For Each meetingRequest In allItemsFolder.Items Set gotoRequest = Application.CreateItem(olAppointmentItem) Set gotoRequest = objFolder.Items.Add(olAppointmentItem) body = meetingRequest.Body subject = meetingRequest.Subject gotoRequest.Subject = subject gotoRequest.ReminderSet = True gotoRequest.ReminderMinutesBeforeStart = 2880 gotoRequest.MeetingStatus = olMeeting sendtoFirstName = UCase(Mid(firstname, 1, 1)) gotoRequest.Body = meetingRequest.Body gotoRequest.Start = startDay & " " & startTime gotoRequest.End = startDay & " " & startTime gotoRequest.Location = county & " County" gotoRequest.RequiredAttendees = sendtoLastName & ", " & sendtoFirstName gotoRequest.Save gotoRequest.Send meetingRequest.UnRead = False meetingRequest.Move sentFolder Next meetingRequest Function GetFolder(FolderPath) ' folder path needs to be something like ' "Public Folders\All Public Folders\Company\Sales" Dim aFolders Dim fldr Dim i Dim objNS ' On Error Resume Next strFolderPath = Replace(FolderPath, "/", "\") aFolders = Split(FolderPath, "\") 'get the Outlook objects ' use intrinsic Application object in form script Set objNS = Application.GetNamespace("MAPI") 'set the root folder Set fldr = objNS.Folders(aFolders(0)) 'loop through the array to get the subfolder 'loop is skipped when there is only one element in the array For i = 1 To UBound(aFolders) Set fldr = fldr.Folders(aFolders(i)) 'check for errors If Err <> 0 Then Exit Function Next Set GetFolder = fldr ' dereference objects Set objNS = Nothing End Function
  12. The Exchange administrators have the ability to limit certain public folders to individuals and groups based on permissions
  13. Great UDF! I can't wait to get this working. I currently have a working version of what I am doing in VB Script, however, we are making it a standalone executable for various reasons. I have written quite a few scripts in AutoIt so I am fairly familiar with its language. Here is my question: I am using the below script to access a public folder on an exchange server. It works fine when I access a folder that is not protected. But, when I try to open a folder that is protected to only me, it returns that there are no mail items. [/size] $oOutlook = _OL_Open() ConsoleWrite("_OL_Open: " & @error & @LF) $Local_Folder = _OL_FolderAccess($oOutlook, "Path\To\Folder\With\Mail\Items") ConsoleWrite("_OL_FolderAccess: " & @error &@extended & @LF) $listofmail = _OL_ItemFind($oOutlook, $Local_Folder[1], $olMail, "[UnRead]=True", "", "", "EntryID,SenderEmailAddress,Subject,Body") ;ConsoleWrite("_OL_ItemFind: " & @error & @LF) ;ConsoleWrite("_OL_ItemFind: " & $listofmail[0][0] & " items found" & @LF) The folder opens and shows the unread messages inside when I use _OL_ItemDisplay($oOutlook, $Local_Folder[1]) Pulling My Hair Out! What am I missing? Thanks in advance!
  14. I am attempting to set printer preferences for a label printer. Based on what the person has entered in a GUI form I need to change the paper height to match. So far things have gone pretty good but now I have run into this problem: Some computers have the printer installed by a different name then the default. (i.e. they have plugged it into multiple USB ports hence creating copies of the label printer.) I am wandering if anyone out there knows how to set printing preferences based off a driver name or some other set variable. I tried playing with the /r function of printui.dll but it says it can't find the printer. Here is what I have so far: Run('rundll32 printui.dll,PrintUIEntry /e /n "ZDesigner RW 420"') ; opens preferences WinWaitActive("Printing Preferences") ; wait for window to be active WinSetState("Printing Preferences","",@SW_HIDE) ;hide preferences (seems useless) $oldheight = ControlGetText("Printing Preferences","","[CLASS:Edit; INSTANCE:3]") ;get current height preference ControlSetText("Printing Preferences","","[CLASS:Edit; INSTANCE:3]",$height) ;set new height preference ControlClick("Printing Preferences","","[CLASS:Button; INSTANCE:12]");submit changes
×
×
  • Create New...