|
 |
asp_cdo thread: calendar updating problem
Message #1 by osmond menezes <osmenzin@y...> on Fri, 6 Apr 2001 22:02:25 -0700 (PDT)
|
|
Hi
presently i am doing updating Calendars
programatically in the exchange server/outlook.
that is creating a new event.
part of code is as follows
-------*****------
Set oAppts = nFolder.Messages
Set oNewAppt = oAppts.Add, ,"IPM.Appointment")
oNewAppt.Subject ="meeting"
oNewAppt.Text ="we have a meeting at 4 pm"
oNewAppt.Location="Dallas"
oNewAppt.AllDayEvent=true
------------****----------------
Here nFolder=Is the cdo folder for Calendar.
Here iam facing problems for Location,AllDayEvent &
othersare concerned.The Subject,Text gets updated
without any problems.
But when it goes Location It gives a error
<error>
object does not support this property or method
</error>I am using exchange server 5.5
cdo.dll version 1.2
microsoft outlook
Note-I am getting this error even for AllDayEvent
and remaning fields of Calendar.please give your
suggetions on this
regards
osz
Message #2 by "Benny Olsson" <benny.olsson@d...> on Mon, 9 Apr 2001 12:46:36
|
|
Hi!
The reason you get this is because nFolder.Messages is NOT the Calendar
folder.
What you need to do is something like this:
1. declare a mapi.session that is accessible thruout the entire
application.
like.
dim gobjSession as mapi.session
set gobjSession = new mapi.session
gobjsession.logon
etc..
Then in the calendar retreiving part you'd write something like this:
dim objAppItem as mapi.appointmentItem
dim objFolder as mapi.folder
set objFolder = gobjsession.getdefaultfolder(cdodefaultfoldercalendar)
for each objAppItem in objFolder
with objAppItem
'Here I pressume you want a specific meeting.. I written the code so that
you'll havto pass along the ID of the meeting you want to update. strID =
the ID of the meeting you want to change.
if .id = strID
'set the properties you want.
.update
end if
end with
next
set objFolder = nothing
set objAppItem = nothing
If you'd like to create a meeting form scratch then use the following:
dim objAppItem as mapi.appointmentItem
dim objFolder as mapi.folder
set objfolder = gobjsession.getdefaultfolder(cdodefaultfoldercalendar)
set objAppItem = objFolder.messages.add
with objAppItem
'Set properties
.update
end with
set objAppItem = nothing
set objfolder = nothing
and then finish by logging off..
gobjsession.logoff
set gobjsession = nothing
well.. That's it.. I hope it helped some.
//Benny Olsson
> Hi
>
> presently i am doing updating Calendars
> programatically in the exchange server/outlook.
> that is creating a new event.
> part of code is as follows
> -------*****------
> Set oAppts = nFolder.Messages
> Set oNewAppt = oAppts.Add, ,"IPM.Appointment")
>
> oNewAppt.Subject ="meeting"
> oNewAppt.Text ="we have a meeting at 4 pm"
> oNewAppt.Location="Dallas"
> oNewAppt.AllDayEvent=true
> ------------****----------------
> Here nFolder=Is the cdo folder for Calendar.
> Here iam facing problems for Location,AllDayEvent &
> othersare concerned.The Subject,Text gets updated
> without any problems.
> But when it goes Location It gives a error
> <error>
> object does not support this property or method
> </error>I am using exchange server 5.5
> cdo.dll version 1.2
> microsoft outlook
> Note-I am getting this error even for AllDayEvent
> and remaning fields of Calendar.please give your
> suggetions on this
> regards
> osz
>
>
Message #3 by osmond menezes <osmenzin@y...> on Mon, 9 Apr 2001 07:42:44 -0700 (PDT)
|
|
Hi
thanks for the suggetions .But the thing is that i am
able to update only the default folder for calendar.
I am facing a problem in updating subfolders.I have
followed the same procedure as u mentioned.But i got
the error as
object does not support this property or method
"objAppItem.Location "
this error appears for all the other fields except
text and subject.from www.cdolive.com i found out
that i should use cdo.dll version 1.2.1.
presently i am using exchange server 5.5 with cdo1.2
this site http://www.cdolive.com/cdo5.htm
says that because this litaion in cdo 1.2 this code is
not working.please give your comments on this
regards
osz
--- Benny Olsson <benny.olsson@d...> wrote:
> Hi!
>
> The reason you get this is because nFolder.Messages
> is NOT the Calendar
> folder.
> What you need to do is something like this:
>
> 1. declare a mapi.session that is accessible thruout
> the entire
> application.
> like.
>
> dim gobjSession as mapi.session
> set gobjSession = new mapi.session
> gobjsession.logon
> etc..
>
> Then in the calendar retreiving part you'd write
> something like this:
>
> dim objAppItem as mapi.appointmentItem
> dim objFolder as mapi.folder
> set objFolder
>
gobjsession.getdefaultfolder(cdodefaultfoldercalendar)
>
> for each objAppItem in objFolder
> with objAppItem
> 'Here I pressume you want a specific meeting.. I
> written the code so that
> you'll havto pass along the ID of the meeting you
> want to update. strID =
> the ID of the meeting you want to change.
> if .id = strID
> 'set the properties you want.
> .update
> end if
> end with
> next
> set objFolder = nothing
> set objAppItem = nothing
>
> If you'd like to create a meeting form scratch then
> use the following:
>
> dim objAppItem as mapi.appointmentItem
> dim objFolder as mapi.folder
> set objfolder
>
gobjsession.getdefaultfolder(cdodefaultfoldercalendar)
> set objAppItem = objFolder.messages.add
> with objAppItem
> 'Set properties
> .update
> end with
> set objAppItem = nothing
> set objfolder = nothing
>
> and then finish by logging off..
> gobjsession.logoff
> set gobjsession = nothing
>
> well.. That's it.. I hope it helped some.
> //Benny Olsson
>
> > Hi
> >
> > presently i am doing updating Calendars
> > programatically in the exchange server/outlook.
> > that is creating a new event.
> > part of code is as follows
> > -------*****------
> > Set oAppts = nFolder.Messages
> > Set oNewAppt = oAppts.Add, ,"IPM.Appointment")
> >
> > oNewAppt.Subject ="meeting"
> > oNewAppt.Text ="we have a meeting at 4 pm"
> > oNewAppt.Location="Dallas"
> > oNewAppt.AllDayEvent=true
> > ------------****----------------
> > Here nFolder=Is the cdo folder for Calendar.
> > Here iam facing problems for Location,AllDayEvent
> &
> > othersare concerned.The Subject,Text gets updated
> > without any problems.
> > But when it goes Location It gives a error
> > <error>
> > object does not support this property or method
> > </error>I am using exchange server 5.5
> > cdo.dll version 1.2
> > microsoft outlook
> > Note-I am getting this error even for AllDayEvent
> > and remaning fields of Calendar.please give your
> > suggetions on this
> > regards
> > osz
> >
>
|
|
 |