Jump to content

HighlanderSword

Active Members
  • Posts

    304
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

HighlanderSword's Achievements

Universalist

Universalist (7/7)

1

Reputation

  1. If I put in the _Excel_Close , it closed the Excel doc before user has closed it
  2. Hello, I have the below code and am running into challenges trying to get excel to close after user closes Excel , the Excel process stays running in the background and will not stop running until the entire script is exited out of, What steps do I need to do to close out the Excel background task after the user closes the Excel doc #include <OutlookEX.au3> #include <MsgBoxConstants.au3> #include <Excel.au3> Global $ooutlook InitOutlook() Func InitOutlook() ; Launch Outlook if not already running. $sRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE" $sOutlookPath = RegRead($sRegKey, "") If ProcessExists("outlook.exe") Then Else ShellExecute($sOutlookPath) Do Until ProcessExists("outlook.exe") Sleep(5000) Sleep(5000) EndIf $ooutlook = _OL_Open() EndFunc Func cal_list() local $aFolder = _OL_FolderAccess($oOutlook, "", $olFolderCalendar) Global $aFolder = _OL_FolderAccess($oOutlook, "", $olFolderCalendar) ; Today's date filter Local $sToday = @YEAR & "-" & StringFormat("%02d", @MON) & "-" & StringFormat("%02d", @MDAY) & " 00:00" Global $aAppointments = _OL_ItemFind($oOutlook, $aFolder[1], $olAppointment, "[Start]>='" & $sToday & "'") ; Open Excel Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookNew($oExcel) Local $oSheet = $oWorkbook.Sheets(1) ; Headers $oSheet.Cells(1, 1).Value = "Subject" $oSheet.Cells(1, 2).Value = "Start Time" ; Fill data For $i = 1 To UBound($aAppointments) - 1 $oSheet.Cells($i + 1, 1).Value = $aAppointments[$i][3] ; Subject Local $dt = ConvertDateStringToExcelSerial($aAppointments[$i][1], $oExcel) $oSheet.Cells($i + 1, 2).Value = $dt Next ; Format column B $oSheet.Columns("B:B").NumberFormat = "mm/dd/yy h:mm AM/PM" $oSheet.Columns("B:B").HorizontalAlignment = -4131 ; xlLeft ; Autofit columns $oSheet.Columns("A:B").AutoFit ; Apply filter $oSheet.Range("A1:B1").AutoFilter ; Sort by Start Time ascending Local $iLastRow = UBound($aAppointments) Local $oRange = $oSheet.Range("A1:B" & $iLastRow) Local $oKey = $oSheet.Range("B2:B" & $iLastRow) ; actual data range in column B $oRange.Sort($oKey, 1, Default, Default, Default, Default, Default, 1) ; xlYes=1 for headers MsgBox(64, "Export Complete", "Appointments written to Excel.") $oSheet = 0 $oWorkbook = 0 $oRange = 0 $oKey= 0 EndFunc Func ConvertDateStringToExcelSerial($sDateTime, $oExcel) If StringLen($sDateTime) < 14 Then Return "" Local $year = StringMid($sDateTime, 1, 4) Local $month = StringMid($sDateTime, 5, 2) Local $day = StringMid($sDateTime, 7, 2) Local $hour = StringMid($sDateTime, 9, 2) Local $min = StringMid($sDateTime, 11, 2) Local $sec = StringMid($sDateTime, 13, 2) ; Build a full datetime string Local $fullDateTime = $month & "/" & $day & "/" & $year & " " & $hour & ":" & $min & ":" & $sec ; Use Excel's Evaluate to parse it as a date Local $serial = $oExcel.Evaluate("DATEVALUE(""" & $month & "/" & $day & "/" & $year & """) + TIMEVALUE(""" & $hour & ":" & $min & ":" & $sec & """)") Return $serial EndFunc #include <TrayConstants.au3> Opt("TrayMenuMode", 1) ; Default tray menu items are hidden ; Create tray menu items Local $idExport = TrayCreateItem("Export Calendar") Local $idExit = TrayCreateItem("Exit") TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray icon While True Switch TrayGetMsg() Case $idExport Cal_List() Case $idExit Exit EndSwitch WEnd
  3. Have a strange issue that just started recently , when outlook opens when called from the UDF , the ribbon has an icon "All Apps" (see screenshot attached) When I run outlook manually this ICON does not appear. Any Ideas ? Using UDF - OutlookEX: 1.7.0.0 2021-11-16 Using Office Pro Plus 2021
  4. ok, I will do some more digging , it can be done from the GUI by right clicking the email and the Assign Policy and the Retention Policy and you pick from the list
  5. ok that set it a folder level, need to set it at the individual email level as folder level as policy runs that reset the folder level
  6. Is there a way using the Outlookex UDF to set the retention policy to a Policy name that is defined by admins (Never Expire)
  7. This is a Great Add on for Scite ! How do you create a New INi File that has all of the settings , thought it would be new profile , but not following why it is asking for a Select(activate) the window you want to track and then click on ok. I worked around this by copying an exiting ini and renaming it and then editing that. Are you working on any new enhancements currently looks like 1.0.0.5 is the latest version
  8. Great that works, so how do I get other elements from the Tagcredential was able to do - $tTargetname = DllStructCreate("wchar string[100]", $tCredential.TargetName) and that worked But below returns nothing and no @error is set as well $tPersist = DllStructCreate("wchar string[100]", $tCredential.Persist) This is my first time working with DllStructiure
  9. Anyone have any luck getting the DLL call to work ?
  10. Looks like when it runs in Chrome the _wd_attach is not getting the details from the second tab , the results come back as null. When it runs in Firefox it gets the details for both tabs , will continue to debug...
  11. Yes a simple attach does work in Chrome
  12. Looking for some help , The below code works fine in Firefox, but does not work in Chrome , that attach fails with $_WD_OPTION_NoMatch = 8 Can see that the new tab has been created and is named DETAILS.pdf , but the attach fails Using ChromeDriver 108.0.5359.71 Using Autoit 3.3.16.1 ;excute script to generate Details and it will open a new tab in Existing Browser , Named Details _WD_ExecuteScript($_MY__WD_SESSION, "submitAction_win0(document.win0,'GET_DETAILS_ALT$0');") ;attach to the new tab , wait loop until the attach returns error code of 0 do _WD_Attach($_MY__WD_SESSION, "DETAILS.pdf") ConsoleWrite("Attaching to details " & @error & "/" & $_MY__WD_SESSION & @crlf) until @error =0
  13. can an admin please delete this , I posted in the wrong location, I have created a new one in the correct location. Thanks
×
×
  • Create New...