Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Creating entries in an Outlook Calendar

by Anonymous Monk
on Apr 20, 2002 at 22:10 UTC ( [id://160814]=note: print w/replies, xml ) Need Help??


in reply to Re: Creating entries in an Outlook Calendar
in thread Creating entries in an Outlook Calendar

Thanks for your reply, I appreciate the positive comments which have been posted.
It was in fact the node you refer to, 110503 which got me started.
The issue is that in our office we use Outlook 2000 and Exchange 2000 and we mainly have laptops.
We also have internet dial up accounts for external e-mails and working offsite.
This means that in Outlook, there are two sets of all the standard folders, inbox, outbox, calendar, drafts etc etc.
One set of folders is under an Outlook Today - Personal Folder, and therefore in a .pst file,
this is the default for all calendar entries. The others are under the Exchange mailbox.
I am trying to build a script which will copy all the calendar entries from the .pst file and place them into the Exchange Mailbox Calendar folder.
I have used the script posted in the node referenced, and it is working perfectly. So I know that I can extract the entries OK.
I am stuck on how to "reverse" the script so that I can write the entires into the Exchange Mailbox Calendar.
whilst this bit of code in the routine specifies the default outlook calendar folder, how can I specify the Exchange folder?
my $namespace = $outlook->GetNameSpace("MAPI") or die "can't open MAPI + namespace\n"; my $recurringitems = $namespace->GetDefaultFolder(olFolderCalendar)->{ +Items}; my $calitems = $namespace->GetDefaultFolder(olFolderCalendar)->{Items} +;
I have tried looking in the Outlook Object Model, but it just didn't make sense to me.

Any help, or nudges in the right direction would be most helpful!

Replies are listed 'Best First'.
Re(3): Creating entries in an Outlook Calendar
by dmmiller2k (Chaplain) on Apr 20, 2002 at 23:05 UTC

    Why don't you enumerate the items in the 'Folders' collection? Each of those is a folder with its own items. See OL2000: Programming Examples for Referencing Items and Folders in Microsoft's knowledge base for more on this.

    Good question, though.

    dmm

    If you GIVE a man a fish you feed him for a day
    But,
    TEACH him to fish and you feed him for a lifetime
      Again, thanks for the reply.
      Well I looked at the suggested reference, but only programming in Perl for a couple of weeks now, it just didn't make sense. I've had 18 years of proramming in Cobol on mainframes and converting to Perl is just fantastic. I've stumbled through generating e-mails and SMS messages OK. I've even been able to look up entries in an access datbase, mostly using code which I have cribbed from this website.
      I just can't figure out where to start on evaluating the folders collection, so if anyone could point me in the right direction I would be most grateful. If I can get them evaluated, then presumably it might give me a clue as to what my target folder is called. Then I can get on with writing the entries I have already extracted, back into that folder.

        If you haven't already, take a look at the article I referenced in my earlier message. You should also view the Win32::OLE docs.

        The short answer is that once you have the 'folders' object (or any collection), you can index it like an array. To wit:

        # from your own example my $outlook = new Win32::OLE('Outlook.Application'); my $ns = $outlook->GetNameSpace("MAPI") or die "can't open MAPI namesp +ace\n"; my $folders = $ns->Folders(); # get the folders collection foreach my $folder (in @$folders) { # here $folder will be set to each folder in turn }

        Hope this helps ..

        dmm

        If you GIVE a man a fish you feed him for a day
        But,
        TEACH him to fish and you feed him for a lifetime
      Thanks again, I have only been learning perl for a couple of weeks, so evaluating the folders collection is still beyond my slowly expanding perl skills.
      Is there any chance you could give me an idea as to how to do this?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://160814]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 23:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found