REALLY NEED HELP! Outlook object model and VB.NET acting funny

E

Elliot Rodriguez

I have a VB.NET project that uses the Outlook object model. On a development
machine, all my references are added, everything tests great, and I have now
moved the project to another staging machine, which has caused numerous
errors to be thrown.

For the objects Outlook. Recipients, Folders, Items, and Attachments, I am
getting compiler errors such as this:

"Expression is of type 'Outlook.Recipients', which is not a collection
type."

Of COURSE it is! This no longer works (worked on my test machine):

for each objRecip in objMailItem.Recipients
objRecip.Resolve()
next

What happened?
 
H

Hollis D. Paul

For the objects Outlook. Recipients, Folders, Items, and Attachments, I am
getting compiler errors such as this:

"Expression is of type 'Outlook.Recipients', which is not a collection
type."

Of COURSE it is! This no longer works (worked on my test machine):

for each objRecip in objMailItem.Recipients
objRecip.Resolve()
next

What happened?
Outlook has to be installed on the staging machine, and your project has to
have a reference set to the outlook OOM that exists there.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 
E

Elliot Rodriguez

Hollis:

Thanks for the reply. Outlook is installed on the staging machine.

I got it to work by changing the code to this (VB)

dim objRecipients as Collection = objMailItem.Recipients

for each objRecip in objRecipients

any idea why this works?

Hollis D. Paul said:
For the objects Outlook. Recipients, Folders, Items, and Attachments, I am
getting compiler errors such as this:

"Expression is of type 'Outlook.Recipients', which is not a collection
type."

Of COURSE it is! This no longer works (worked on my test machine):

for each objRecip in objMailItem.Recipients
objRecip.Resolve()
next

What happened?
Outlook has to be installed on the staging machine, and your project has to
have a reference set to the outlook OOM that exists there.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top