Syed23 Posted September 30, 2014 Posted September 30, 2014 (edited) Dear All, I am getting Norm.dotm file to be opened request when i display array. is that something i can do stop prompting that message? #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Example 1 ; List all Email signatures for the current mail account ; ***************************************************************************** Global $aSignatures = _OL_MailSignatureGet() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailSignatureGet Example Script", "Error accessing mail signatures. @error = " & @error & ", @extended: " & @extended) _ArrayDisplay($aSignatures) _OL_Close($oOutlook) Edited September 30, 2014 by Syed23 Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]
water Posted October 1, 2014 Posted October 1, 2014 The function uses Microsoft Word under the covers to retrieve the data. I have no idea why you get this error. You could start Word yourself and pass the Word application object as parameter 2. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Syed23 Posted October 1, 2014 Author Posted October 1, 2014 adding the below lines before _arraydisplay() helped me to resolve the issue. ProcessClose("WINWORD.EXE") Sleep(800) Thank you water for your reply. Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]
water Posted October 1, 2014 Posted October 1, 2014 Does this work without killing Word? expandcollapse popup#include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) Global $aSignatures = _OL_MailSignatureGetEX() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailSignatureGet Example Script", "Error accessing mail signatures. @error = " & @error & ", @extended: " & @extended) _ArrayDisplay($aSignatures) _OL_Close($oOutlook) Func _OL_MailSignatureGetEX($sSignature = "", $oWord = 0) Local $bWordStart = False If $oWord = 0 Then $oWord = ObjCreate("Word.Application") $bWordStart = True EndIf If @error Or Not IsObj($oWord) Then Return SetError(1, @error, "") Local $oEmailOptions = $oWord.EmailOptions Local $oSignatureObject = $oEmailOptions.EmailSignature Local $oSignatureEntries = $oSignatureObject.EmailSignatureEntries Local $sNewMessageSig = $oSignatureObject.NewMessageSignature Local $sReplyMessageSig = $oSignatureObject.ReplyMessageSignature Local $aSignatures[$oSignatureEntries.Count + 1][3] Local $iIndex = 0 For $oSignatureEntry In $oSignatureEntries If $sSignature = "" Or $sSignature == $oSignatureEntry.Name Then $iIndex = $iIndex + 1 $aSignatures[$iIndex][0] = $oSignatureEntry.Name If $aSignatures[$iIndex][0] = $sNewMessageSig Then $aSignatures[$iIndex][1] = True Else $aSignatures[$iIndex][1] = False EndIf If $aSignatures[$iIndex][0] = $sReplyMessageSig Then $aSignatures[$iIndex][2] = True Else $aSignatures[$iIndex][2] = False EndIf EndIf Next ReDim $aSignatures[$iIndex + 1][3] $aSignatures[0][0] = $iIndex $aSignatures[0][1] = UBound($aSignatures, 2) If $bWordStart = True Then Local Const $wdDoNotSaveChanges = 0 ; Do not save pending changes $oWord.Quit($wdDoNotSaveChanges) $oWord = 0 EndIf If $sSignature <> "" And $aSignatures[0][0] = 0 Then Return SetError(2, 0, "") Return $aSignatures EndFunc ;==>_OL_MailSignatureGetEX My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Syed23 Posted October 1, 2014 Author Posted October 1, 2014 Yes Water! This works perfect and awesome! Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]
water Posted October 1, 2014 Posted October 1, 2014 Great! I will change the UDF accordingly. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now