CopyTo() does not work on Outlook XP

G

Guest

I've written a small vbs to copy a user's Calendar folder to a local .pst file. It works fine on a machine with Outlook 2000 but not on a machine with Outlook XP. Also on the Outlook XP machine, I get a couple of pop-up windows asking if I want to allow some program to access the information stored in Outlook. Lowering the security level to low didn't help much - the windows still pop up. Please let me share your tips on how to make CopyTo work for Outlook XP and avoiding pop-ups

This is the script. I run this while Outlook is up and running with Exchange Administrator Profile
===================
Set ol = CreateObject ("Outlook.Application"
Set ns = ol.GetNameSpace ("MAPI"
Set myRecipient = ns.CreateRecipient("SourceUser"
myRecipient.Resolv
If myRecipient.Resolved The
Set contacts = ns.GetSharedDefaultFolder(myRecipient, 9
End I
set localFolder = ns.Folders("Personal Folders") 'This represents the .pst fil
set newfolder = contacts.CopyTo(localFolder) 'This line fails on Outlook XP with Error Number 424, "Object Required
 
S

Sue Mosher [MVP-Outlook]

The security prompts are being triggered by CreateRecipient and the other
methods related to recipients. See
http://www.slipstick.com/outlook/esecup.htm#autosec for your options.

Have you checked to see whether you actually have contacts and localFolder
objects?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



sparkie said:
I've written a small vbs to copy a user's Calendar folder to a local .pst
file. It works fine on a machine with Outlook 2000 but not on a machine
with Outlook XP. Also on the Outlook XP machine, I get a couple of pop-up
windows asking if I want to allow some program to access the information
stored in Outlook. Lowering the security level to low didn't help much -
the windows still pop up. Please let me share your tips on how to make
CopyTo work for Outlook XP and avoiding pop-ups.
This is the script. I run this while Outlook is up and running with
Exchange Administrator Profile.
====================
Set ol = CreateObject ("Outlook.Application")
Set ns = ol.GetNameSpace ("MAPI")
Set myRecipient = ns.CreateRecipient("SourceUser")
myRecipient.Resolve
If myRecipient.Resolved Then
Set contacts = ns.GetSharedDefaultFolder(myRecipient, 9)
End If
set localFolder = ns.Folders("Personal Folders") 'This represents the ..pst file
set newfolder = contacts.CopyTo(localFolder) 'This line fails on Outlook
XP with Error Number 424, "Object Required"
 

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