A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Array of outlook items....HELP!!



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 23rd 06, 05:26 PM posted to microsoft.public.outlook.program_vba
WhytheQ
external usenet poster
 
Posts: 21
Default Array of outlook items....HELP!!

I'm using the following code, from Excel, with no reference to Outlook:


Dim objOutlook As Object
Dim objMailItem As Object

Dim myCreatedEmails() As Object

Sub CreateAndDisplayEmails()

Set objOutlook = CreateObject("Outlook.Application")

Erase myCreatedEmails

For i = 1 To 3

Set objMailItem = objOutlook.CreateItem(0)

With objMailItem
.To = "Tester" & i
.Subject = "Tester" & i
End With

ReDim myCreatedEmails(k)
'##### falls down on next line #####
myCreatedEmails(k) = objMailItem
k = k + 1

Next i

For k = 1 To UBound(myCreatedEmails)
myCreatedEmails(k).Display
Next k

End Sub


....I've marked where it already falls down and I assume even if this
line is fixed then it'll fall down later on on the line
"myCreatedEmails(k).Display"

The above must be pretty bl##dy close!...can anyone help?

Help appreciated
Jason

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to retain 10 days items in Outlook 2003 deleted items folder? Balthazar Outlook - Installation 2 June 7th 06 04:05 PM
Reading mails from Sent items, Deleted items, Draft folder of outlook from VB6.0 Viswanathan Outlook - General Queries 8 May 26th 06 04:31 PM
Can't delete items or move items in Outlook 2002 Garret Swayne Outlook - General Queries 2 April 14th 06 08:15 AM
Download free program for array phone codes correction Victor Bilous Outlook - General Queries 5 February 1st 06 09:18 PM
Download free program for array phone codes correction Victor Bilous Outlook - Using Contacts 0 January 31st 06 07:20 AM


All times are GMT +1. The time now is 09:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright Đ2004-2024 Outlook Banter.
The comments are property of their posters.