This is the error message.
If you have a link to a place where i can relearn all of the outlook automation, including selecting which calendar to update and pretty much all of it.
I will be thanking you all very much.
At some point in time a redundancy was created, probably do to accidently pasting a line of code. apparently I never tried to add a an attachment. Mostly because that function in the database was abandoned.
The GPT Found it though.
It looks like there's a redundancy in the attachment section of your code. You are adding the attachment twice, which could lead to the "Array Index Out of Bounds" error. Specifically, you have the line:
vbaCopy code
.Attachments.Add Me.txtAttachment
both before and after the loop that handles multiple attachments. To resolve this issue, you should remove the redundant line outside the loop. Here's the modified section:
Code:
Copy code
'<<<Start Attachment Section
If InStr(Me.txtAttachment, ";") = 0 Then
.Attachments.Add Me.txtAttachment
Else
strAttachments = Me.txtAttachment
' Parse Attachments and add them to the Attachments collection.
Do
.Attachments.Add Left(strAttachments, InStr(strAttachments, ";") - 1)
strAttachments = Trim(Mid(strAttachments, InStr(strAttachments, ";") + 1))
Loop While InStr(strAttachments, ";") <> 0
If Len(strAttachments) > 0 Then .Attachments.Add strAttachments
End If
'<<<End Attachment Section