Array out of bounds .display 2016

Status
Not open for further replies.

Treebys

Member
Outlook version
Email Account
Exchange Server
Hi, I hope someone can help. I have an Access 2003 database that has a Sub using VBA to create an email in the background, attach documents and then when ready display (or should). This has always worked fine until Office 2016. It seems to run the entire code ok until it hits .display as which point I get an 'Array Out of Bounds' error. The syntax appears to be correct and as I have said it worked on previous office version including 2015. The Sub creates an email . It's a lengthy bit of code but here is the section in question:

Set OLNS = objOutlook.GetNamespace("MAPI")
Set MailFolder = OLNS.GetDefaultFolder(olFolderDrafts)
objOutlook.ActiveWindow
Set MailFolder = OLNS.GetDefaultFolder(olFolderDrafts)
MailFolder.Display
Set objEmail = MailFolder.Items.Add

With objEmail
.To = strTo
.CC = strCc
.Subject = strSubject
.HTMLBody = strBody
objEmail.Attachments.Add strReportSummary
If blnDec = True Then
objEmail.Attachments.Add strDec
End If
objEmail.Attachments.Add CurrentProject.path & "\" & "KeyFacts.pdf"
objEmail.Attachments.Add CurrentProject.path & "\" & "Client Agreement.pdf"
.Display
End With

Any help/ideas appreciated. Thanks in advance.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
or.. does it work if you use objEmail.display? Also, if you copy/pasted it, delete that line and retype it. I had issues with some leading spaces one time - for whatever stupid reason, outlook didn't see them as spaces. deleting and retyping them fixed it.
 

Treebys

Member
Outlook version
Email Account
Exchange Server
Sorry I forgot which forum I posted this too. It's in an Access database and I was looking at my Access forum. So ....

Diane, I think you were right, thank you. I noticed something very odd. I opened the module and searched for '.Display' it cycled through 21 instances of it in the code but did not find/recognise the problem one (in sbEmail). I tried this several times and every time it missed the two instances of it in sbEmail.

I then tried highlighting '.Display' in sbEmail and then Ctrl+F again it found the 2 in sbEmail and the other 21. I then tried searching '.Display' again and this time at found all 23. It's as though it didn't recognise the ones in sbEmail but now suddenly does!?!

Anyway, it seems to be working now. Fingers-crossed!

Thanks again.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
J Add an Attachment Using an Array and Match first 17 Letters to Matching Template .oft to Send eMail Outlook VBA and Custom Forms 2
G [Help] Converting array to destination folder path Outlook VBA and Custom Forms 1
J Storing userproperties to array Outlook VBA and Custom Forms 4
Dr. Demento Outlook output to array -> Excel & re-format Using Outlook 2
L Outlook clients did not reconnect to Exchange when one CAS server in CAS array became unresponsive Exchange Server Administration 1
G Array of Outlook 2007 Errors Using Outlook 3
B CAS Array and NLB Exchange Server Administration 3
D CAS Array Question Exchange Server Administration 11
M Proper way to install Exchange 2010 SP1 on a CAS Array Exchange Server Administration 3
J Segmenting IMAP traffic from CAS Array Exchange Server Administration 8
B CAS Array and Outlook 2003 clients Exchange Server Administration 5
S CAS array in Exchange 2010 Exchange Server Administration 1
G Exchange 2010 CAS Array Exchange Server Administration 4
J Geographically redundant cas array Exchange Server Administration 15
D CAS Array Questions Exchange Server Administration 3
T Exchange 2010 CAS Array setup and lab Exchange Server Administration 18
T How to get Exchange 2003 OWA SSO authentication to work with Internal TMG Array web listener Exchange Server Administration 1
S NLB exchange 2010 CAS Array Exchange Server Administration 4
S Access CAS Array Behind ISA 2006 Exchange Server Administration 6
C Introduce another CAS/HT server on the cas array on NLB Exchange Server Administration 7
P DNS Round Robin on CAS Array Exchange Server Administration 5
B After rebooting one of the cas array servers blackbarry stops working Exchange Server Administration 1
B cas array exchnage 2010 not working properly on vm Exchange Server Administration 5
S One CAS Array for mulitple site Exchange Server Administration 2
S CAS Array - NLB - Can't Ping VIP Exchange Server Administration 4
R accessing owa externally and having a cas array internally Exchange Server Administration 9
K CAS array SSL cert -RPC cas certificate warning Exchange Server Administration 3
S What to Use Instead a Hardware-based Load Balancer for an Exchange 2010 CAS Array Exchange Server Administration 21
R cas array owa is slow Exchange Server Administration 5
S Created CAS Array - Outlook certificate error Exchange Server Administration 2
S Exchange 2010 two datacenters two CAS array Exchange Server Administration 4
A RPC Client Access Array Question Exchange Server Administration 11
B Do we need to create a CAS Array for a single server site? Exchange Server Administration 3
M CAS Array Exchange Server Administration 6
J Autodiscover not issuing CAS array to Outlook Clients Exchange Server Administration 2
R Installing SP1 on Hub/CAS servers in CAS Array Exchange Server Administration 9
R CAS array not working with Outlook Exchange Server Administration 15
B CAS Array article...? Exchange Server Administration 2
C Cas array question Exchange Server Administration 12
T Rename CAS array Exchange Server Administration 4
S CAS array legacy URL Exchange Server Administration 9
S CAS array in exchange 2003 and exchange 2010 coexsit environment Exchange Server Administration 4
S Looking for feedback on this CAS Array testing plan Exchange Server Administration 2
H CAS Array / OWA issues Exchange Server Administration 9
C CAS Array and Outlook Exchange Server Administration 3
H Client Access Array question Exchange Server Administration 5
C How to assign certificate(s) to an CAS array? Exchange Server Administration 1
C how should i assign an SSL certificate to a CAS array? Exchange Server Administration 2
Z Active SynC Issue in Exchange 2010 on CAS Array Exchange Server Administration 4
T CAS Array/RPCClientAccessServer and Outlook profile experiences Exchange Server Administration 8
Similar threads


















































Top