Jump to content

Recommended Posts

Posted (edited)

Hello,

just stating to test this UDF, but i cant start it because of this error on any example script.

Error Creating Test Folder Structure 'Outlook-UDF-Test\SourceFolder'"

@error:301, @extended:3

using  outlook 2016 C2R

Edited by Raffav
Posted

C2R seems to be a one-click installation program for Office.
Which version did you install?

• ProPlusRetail
• ProfessionalRetail
• HomeStudentRetail
• HomeBusinessRetail
• O365ProPlusRetail
• O365HomePremRetail
• O365BusinessRetail
• O365SmallBusPremRetail
• VisioProRetail
• ProjectProRetail
• SPDRetail

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

 

Posted

In your mailbox there should be a folder "\Outlook-UDF-Test\SourceFolder". Are there any subfolders in this folder?

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

 

Posted
On 25/11/2016 at 6:44 PM, water said:

In your mailbox there should be a folder "\Outlook-UDF-Test\SourceFolder". Are there any subfolders in this folder?

yes and no,

the folder is created but is bugy, when go the folder all my outlook turns a calendar, and i cant see if there is any  subfolders

Posted
On 25/11/2016 at 6:44 PM, water said:

In your mailbox there should be a folder "\Outlook-UDF-Test\SourceFolder". Are there any subfolders in this folder?

yes and no,

the folder is created but is bugy, when go the folder all my outlook turns a calendar, and i cant see if there is any  subfolders

 

Posted
On 25/11/2016 at 6:44 PM, water said:

In your mailbox there should be a folder "\Outlook-UDF-Test\SourceFolder". Are there any subfolders in this folder?

yes and no,

the folder is created but is bugy, when go the folder all my outlook turns a calendar, and i cant see if there is any  subfolders

 

Posted

I have updated function _OL_TestEnvironmentCreate so the folders/subfolders are created with the correct type.
If you replace the function in the UDF the problem should be solved.

; #INTERNAL_USE_ONLY#============================================================================================================
; Name ..........: _OL_TestEnvironmentCreate
; Description ...: Deletes and recreates the OutlookEX UDF test environment.
; Syntax.........: _OL_TestEnvironmentCreate($oOL[, $vDontAsk = ""[, $vDontDelete= ""]])
; Parameters ....: $oOL         - Outlook object returned by a preceding call to _OL_Open()
;                  $vDontAsk    - Optional: Return error if folder already exists? 1 = no, 4 = yes, "" = read value from ini file
;                  $vDontDelete - Optional: Delete test environment if it already exists? 1 = no, 4 = yes, "" = read value from ini file
; Return values .: Success - 1
;                  Failure - 0 and sets @error:
;                  |1 - Folder *\Outlook-UDF-Test already exists and user denied to delete/recreate the testenvironment
;                  |2 - Error deleting folder. @extended is @error as returned by _OL_FolderDelete
;                  |3 - Error creating root source folder (*\Outlook-UDF-Test\SourceFolder). @extended is set to @error as returned by _OL_FolderCreate
;                  |3xx - Error creating source folder. @extended is set to @error as returned by _OL_FolderCreate
;                  |4 - Error creating root target folder (*\Outlook-UDF-Test\TargetFolder). @extended is set to @error as returned by _OL_FolderCreate
;                  |4xx - Error creating target folder. @extended is set to @error as returned by _OL_FolderCreate
;                  |5xx - Error creating item in source folder. @extended is set to @error as returned by _OL_<itemtype>Create
;                  |6xx - Error creating item in target folder. @extended is set to @error as returned by _OL_<itemtype>Create
; Author ........: water
; Modified ......:
; Remarks .......: The test environment consists of the following items:
;                    * Folder Outlook-UDF-Test, subfolders plus items
;                    * Group "Outlook-UDF-Test" in the Outlook bar
;                    * Shortcut int the "Outlook-UDF-Test" group in the Outlook bar
;                    * Category "Outlook-UDF-Test" in the Outlook bar
;                    * Mail signature "Outlook-UDF-Test"
;                    * PST "Outlook-UDF-Test" in "C:\temp\Outlook-UDF-Test.pst"
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func _OL_TestEnvironmentCreate($oOL, $vDontAsk = "", $vDontDelete = "")

    Local $vResult, $sCurrentUser = $oOL.GetNameSpace("MAPI").CurrentUser.Name
    ;---------------------------------
    ; Delete existing folder structure
    ;---------------------------------
    If _OL_FolderExists($oOL, "*\Outlook-UDF-Test") Then
        If StringStripWS($vDontAsk, 3) = "" Then $vDontAsk = IniRead("_OL_TestEnvironment.ini", "Configuration", "DontAsk", "4") ; checked = 1, unchecked = 4
        If StringStripWS($vDontDelete, 3) = "" Then $vDontDelete = IniRead("_OL_TestEnvironment.ini", "Configuration", "DontDelete", "4") ; checked = 1, unchecked = 4
        If $vDontDelete = 4 Then
            If $vDontAsk = 4 Then
                Local $iResult = MsgBox(35, "OutlookEX UDF - Create Test Environment", "Testenvironment already exists. Should it be deleted and recreated?")
                If $iResult = 2 Then Return SetError(1, 0, 0)
                If $iResult = 7 Then Return 1
            EndIf
            If $vDontAsk = 1 Or $iResult = 6 Then _OL_FolderDelete($oOL, "*\Outlook-UDF-Test")
        Else
            Return 1
        EndIf
        If @error Then Return SetError(2, @error, 0)
    EndIf
    ;------------------------------------------------------------
    ; Create Source Folder plus one subfolder for every item type
    ;------------------------------------------------------------
    _OL_FolderCreate($oOL, "Outlook-UDF-Test\SourceFolder", $olFolderInbox)
    If @error Then Return SetError(3, @error, 0)
    Local $oSourceFolderCalendar = _OL_FolderCreate($oOL, "Calendar", $olFolderCalendar, "*\Outlook-UDF-Test\SourceFolder")
    If @error Then Return SetError(300, @error, 0)
    Local $oSourceFolderContact = _OL_FolderCreate($oOL, "Contacts", $olFolderContacts, "*\Outlook-UDF-Test\SourceFolder")
    If @error Then Return SetError(301, @error, 0)
    ; Mark the folder as address book and change the name
    $oSourceFolderContact.ShowAsOutlookAB = True
    $oSourceFolderContact.AddressBookName = "Outlook-UDF-Test"
    If @error Then Return SetError(302, @error, 0)
    Local $oSourceFolderMail = _OL_FolderCreate($oOL, "Mail", $olFolderInbox, "*\Outlook-UDF-Test\SourceFolder")
    If @error Then Return SetError(303, @error, 0)
    Local $oSourceFolderNotes = _OL_FolderCreate($oOL, "Notes", $olFolderNotes, "*\Outlook-UDF-Test\SourceFolder")
    If @error Then Return SetError(304, @error, 0)
    Local $oSourceFolderTasks = _OL_FolderCreate($oOL, "Tasks", $olFolderTasks, "*\Outlook-UDF-Test\SourceFolder")
    If @error Then Return SetError(305, @error, 0)
    ;-----------------------------------
    ; Create test items in Source Folder
    ;-----------------------------------
    ; Appointment
    Local $sStartTime = StringMid(_DateAdd("n", -10, _NowCalc()), 12, 5)
    Local $sEndTime = StringMid(_DateAdd("h", 3, _NowCalc()), 12, 5)
    Local $oItem = _OL_ItemCreate($oOL, $olAppointmentItem, $oSourceFolderCalendar, "", "Subject=TestAppointment", _
            "Start=" & _NowCalcDate() & " " & $sStartTime, "End=" & _NowCalcDate() & " " & $sEndTime, _
            "ReminderMinutesBeforeStart=15", "ReminderSet=True", "Location=Building A, Room 10")
    If @error Then Return SetError(500, @error, 0)
    ; Appointment: Add optional recipient
    _OL_ItemRecipientAdd($oOL, $oItem, Default, $olOptional, $sCurrentUser)
    If @error Then Return SetError(501, @error, 0)
    ; Appointment: Add recurrence: Daily with defined start and end date/time
    _OL_ItemRecurrenceSet($oOL, $oItem, Default, _NowCalcDate(), $sStartTime, _DateAdd("D", 14, _NowCalcDate()), $sEndTime, $olRecursDaily, "", "", "")
    If @error Then Return SetError(502, @error, 0)
    ; Define exception
    Local $sTemp = _DateAdd("D", 1, _NowCalcDate())
    _OL_ItemRecurrenceExceptionSet($oOL, $oItem, Default, $sTemp & " " & $sStartTime & ":00", $sTemp & " 08:00:00", $sTemp & " 14:00:00", "TestException", "ExceptionBody")
    If @error Then Return SetError(503, @error, 0)
;   ; Appointment: Create a conflict
;   $oItem = _OL_ItemCreate($oOL, $olAppointmentItem, $oSourceFolderCalendar, "", "Subject=TestAppointment-Conflict", _
;           "Start=" & _NowCalcDate() & " " & $sStartTime, "End=" & _NowCalcDate() & " " & $sEndTime)
;   If @error Then Return SetError(504, @error, 0)
    ; Contact
    _OL_ItemCreate($oOL, $olContactItem, $oSourceFolderContact, "", "FirstName=TestFirstName", "LastName=TestLastName")
    If @error Then Return SetError(505, @error, 0)
    ; Distribution List + Member
    $vResult = _OL_ItemCreate($oOL, $olDistributionListItem, $oSourceFolderContact, "", "Subject=TestDistributionList", "Importance=" & $olImportanceHigh)
    If @error Then Return SetError(506, @error, 0)
    _OL_DistListMemberAdd($oOL, $vResult, Default, $sCurrentUser)
    If @error Then Return SetError(507, @error, 0)
    ; Mail plus attachment
    $vResult = _OL_ItemCreate($oOL, $olMailItem, $oSourceFolderMail, "", "Subject=TestMail", "BodyFormat=" & $olFormatHTML, "HTMLBody=Bodytext in <b>bold</b>.", "To=" & $sCurrentUser)
    If @error Then Return SetError(508, @error, 0)
    _OL_ItemAttachmentAdd($oOL, $vResult, Default, @ScriptDir & "\The_Outlook.jpg")
    If @error Then Return SetError(509, @error, 0)
    ; Note
    _OL_ItemCreate($oOL, $olNoteItem, $oSourceFolderNotes, "", "Width=350", "Body=TestNote")
    If @error Then Return SetError(510, @error, 0)
    ; Task
    _OL_ItemCreate($oOL, $olTaskItem, $oSourceFolderTasks, "", "Subject=TestSubject", "StartDate=" & _NowDate())
    If @error Then Return SetError(511, @error, 0)
    ;------------------------------------------------------------
    ; Create Target Folder plus one subfolder for every item type
    ;------------------------------------------------------------
    _OL_FolderCreate($oOL, "TargetFolder", $olFolderInbox, "*\Outlook-UDF-Test")
    If @error Then Return SetError(4, @error, 0)
    _OL_FolderCreate($oOL, "Calendar", $olFolderCalendar, "*\Outlook-UDF-Test\TargetFolder")
    If @error Then Return SetError(400, @error, 0)
    _OL_FolderCreate($oOL, "Contacts", $olFolderContacts, "*\Outlook-UDF-Test\TargetFolder")
    If @error Then Return SetError(401, @error, 0)
    _OL_FolderCreate($oOL, "Mail", $olFolderInbox, "*\Outlook-UDF-Test\TargetFolder")
    If @error Then Return SetError(402, @error, 0)
    _OL_FolderCreate($oOL, "Notes", $olFolderNotes, "*\Outlook-UDF-Test\TargetFolder")
    If @error Then Return SetError(403, @error, 0)
    _OL_FolderCreate($oOL, "Tasks", $olFolderTasks, "*\Outlook-UDF-Test\TargetFolder")
    If @error Then Return SetError(404, @error, 0)
    Return 1

EndFunc   ;==>_OL_TestEnvironmentCreate

 

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

 

Posted

Version 1.2.2.0 of the UDF has been released.

Please test before using in production!

For download please see my signature.

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

 

Posted

Can you please delete the existing Outlook-UDF-Test folder and all it's subfolders by hand and then retry?

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

 

Posted (edited)
1 hour ago, water said:

Can you please delete the existing Outlook-UDF-Test folder and all it's subfolders by hand and then retry?

That is the problem, there is no folder at all

do you have the previus version code,  on that i was able to delete, so i could try and see if i can remove it

never mind

dont worked, i will restart pc

 

 

 

Edited by Raffav
Posted

-2147352567 (decimal) = 0x80020009 (hex) stands for: Exception occurred.
Means: Outlook tells us that it doesn't know what happened.

I have Outlook 2010 installed. With Ctrl+6 Outlook shows the folder pane (Ctrl+1 shows the mail pane). There is no Outlook-UDF-Test folder?

Please check the trash bin for deleted Outlook-UDF-Test folders. If there are please delete them. I remember that an older version of Outlook didn't delete a  folder when there was a folder with the same name in the trash bin already.

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

 

Posted (edited)
36 minutes ago, water said:

-2147352567 (decimal) = 0x80020009 (hex) stands for: Exception occurred.
Means: Outlook tells us that it doesn't know what happened.

I have Outlook 2010 installed. With Ctrl+6 Outlook shows the folder pane (Ctrl+1 shows the mail pane). There is no Outlook-UDF-Test folder?

Please check the trash bin for deleted Outlook-UDF-Test folders. If there are please delete them. I remember that an older version of Outlook didn't delete a  folder when there was a folder with the same name in the trash bin already.

Some progress, but new error

error 501 / extended 400 

PS: iam using  multiple imap accounts

 

Capture.PNG

Edited by Raffav
Posted

This error means that a meeting could not be created because the recipient could not be resolved.
What do you get when you run

$sCurrentUser = $oOL.GetNameSpace("MAPI").CurrentUser.Name
MsgBox(0, "", $sCurrentUser)

 

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

 

Posted
14 hours ago, water said:

This error means that a meeting could not be created because the recipient could not be resolved.
What do you get when you run

$sCurrentUser = $oOL.GetNameSpace("MAPI").CurrentUser.Name
MsgBox(0, "", $sCurrentUser)

 

i get my name,

i dont  know if that metter but my  email account is IMAP

i had edit my name to remove space but the problem is the same

Capture.PNG

Posted

Another try to get more information:

#include <OutlookEX.au3>
Global $oOL = _OL_Open()
_OL_ErrorNotify(2)
_OL_TestEnvironmentCreate($oOL)

This should display detailed COM error information.

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

 

Posted
7 minutes ago, water said:

Another try to get more information:

#include <OutlookEX.au3>
Global $oOL = _OL_Open()
_OL_ErrorNotify(2)
_OL_TestEnvironmentCreate($oOL)

This should display detailed COM error information.

 

 

Capture.PNG

Posted

If you create a mail item and add "Raffaello Vaselli" as recipient is Outlook able to resolve to a valid address?
Seems that Outlook is not able to resolve the recipient because there is no address book with such an entry.

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

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...