Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / February 2004

Tip: Looking for answers? Try searching our database.

CopyTo() does not work on Outlook XP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sparkie - 27 Feb 2004 23:01 GMT
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
Sue Mosher [MVP-Outlook] - 27 Feb 2004 23:49 GMT
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?

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> 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.
> ====================
[quoted text clipped - 7 lines]
> 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"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.