object variable error 91 when sync in outlook 2000

  • Thread starter Thread starter Janette
  • Start date Start date
J

Janette

Hi,

I have a VBA executable that opens a pop3 mail box and after synching,
processes the mail. It works on one server but on the other it gives "91 :
object variable or with block variable not set" when it does the following

Set olApp = New Outlook.Application
Set onMAPI = olApp.GetNamespace("MAPI")
onMAPI.Logon , , , True
Set sync = onMAPI.SyncObjects
Set osync = sync.Item("Mail Account")
Set syncevent = New syncevents
osync.Start
' **
Do Until sync_done
DoEvents ' Yield to other processes.
Loop


It never gets to '** it gives the object variable error. Can anyone suggest
what might be the problem. I have checked and both servers run the same
version of outlook 2000.

Thanks
Janette
 
Am Thu, 28 Jul 2005 12:14:50 +1000 schrieb Janette:

Hi Janette,

if osync.Start throws that error then osync is Nothing. That is,
sync.Item("Mail Account") returns Nothing. This in turn means there´s no
item called "Mail Account" in the sync list.
 
Hi Michael,

Thanks for your reply. I didn't setup the original server so I am new to
this. When I setup the new server, I setup the pop3 account in outlook and
choose the name "Mail Account". I take it I need to do something else apart
from this to create the "Mail Account" item. Can you give me a pointer in
the right direction.

Thanks
Janette
 
Hi,

I worked out where the problem was, I needed to call the mail server "Mail
Account". It appears to be working now.

Thanks
Janette
 
Back
Top