Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 5th, 2005, 04:30 AM
yoov yoov is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Israel
Posts: 9 yoov User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 10 sec
Reputation Power: 0
Send a message via MSN to yoov
Unhappy Need help updating outlook appointment using vbs

Hello

I am trying to use vbs to change all of our organization's recurrence appointments to start one hour earlier and end one hour earlier. for some reason i just can't do it. the calender is not being updated with the new times.
I need all of the meetings to change!

this is the code I am using:
Code:
 Const CdoDefaultFolderCalendar = 0      'Calendar
 Const CdoDefaultFolderInbox = 1           'Inbox
 Const CdoMeetingItem = 27
 Const szCalendar = "Calendar"
 Dim ChangeDate
 '=================================================  ==
 Dim szServer, szMailbox
 Dim mapiSession
 Dim ObjFolder
 Dim strday, strmonth, strYear, strHour, strMinute, strsecond
 Dim strEday, strEmonth, strEYear, strEHour, strEMinute, strEsecond
 Dim NewEndTime
 Dim NewStartTime
 Dim strAppointmentdate
 '=================================================  ========================
 szServer = InputBox("Enter Your Exchange Server name: ", "Server Name", "IGMAIL")
 szMailbox = InputBox("Enter Your Alias name: ", "Mailbox Name", "liord")
 '=================================================  ===========================
 Set mapiSession = CreateObject("MAPI.Session")
 mapiSession.Logon , , , , , , szServer & vbLf & szMailbox
 Set ObjFolder = mapiSession.GetDefaultFolder(CdoDefaultFolderCalen  dar)
   Set objAppointments = ObjFolder.Messages
 '=================================================  =======================
 For Each Appointment In objAppointments
  If Appointment.IsRecurring = True Then
 'WScript.Echo Appointment.Class
 'WScript.Echo Appointment
 Set objRecurPatt = Appointment.GetRecurrencePattern
 '=================================================  =======================
 strday = Day(objRecurPatt.StartTime)
 If strday < 10 Then
 strday = "0" & strday
 End If
 strmonth = Month(objRecurPatt.StartTime)
 If strmonth < 10 Then
 strmonth = "0" & strmonth
 End If
 strYear = Year(objRecurPatt.StartTime)
 strHour = Hour(objRecurPatt.StartTime) - 1
 If strHour < 10 Then
 strHour = "0" & strHour
 End If
 strMinute = Minute(objRecurPatt.StartTime)
 If strMinute < 10 Then
 strMinute = "0" & strMinute
 End If
 strsecond = "00"
 '=================================================  =================================
 strEday = Day(objRecurPatt.EndTime)
 If strEday < 10 Then
 strEday = "0" & strEday
 End If
 strEmonth = Month(objRecurPatt.EndTime)
 If strEmonth < 10 Then
 strEmonth = "0" & strEmonth
 End If
 strEYear = Year(objRecurPatt.EndTime)
 strEHour = Hour(objRecurPatt.EndTime) - 1
 If strEHour < 10 Then
 strEHour = "0" & strEHour
 End If
 strEMinute = Minute(objRecurPatt.EndTime)
 If strEMinute < 10 Then
 strEMinute = "0" & strEMinute
 End If
 strEsecond = "00"
 '=================================================  ================================
 NewEndTime = strEmonth&"/"&strEday&"/"&strEYear & " " & strEHour&":"&strEMinute&":"&strEsecond
 NewStartTime = strmonth&"/"&strday&"/"&strYear & " " & strHour&":"&strMinute&":"&strsecond
 '=================================================  =======================
 objRecurPatt.StartTime = NewStartTime
 objRecurPatt.EndTime = NewEndTime
 Appointment.update makePermanent = True 
 '=================================================  ========================
 End If
 Next
  
 mapiSession.Logoff
 Set mapiSession = Nothing
 


Please someone help me!
10x

Last edited by Shadow Wizard : April 5th, 2005 at 05:15 AM. Reason: added code tags - please do it yourself with [code] and [/code] tags next.

Reply With Quote
  #2  
Old April 5th, 2005, 05:18 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,993 Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342508 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 5 Days 16 h 39 m 38 sec
Reputation Power: 1556
I think vbscript simply does not have such power as it's only scripting language.
consider making this via full application created in language such as VB or C++ and it should work fine.
anyway, maybe the problem is only with permissions, but I don't know the proper permissions you need in this case. full scale application has those by default.

Reply With Quote
  #3  
Old April 5th, 2005, 06:23 AM
yoov yoov is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Israel
Posts: 9 yoov User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 10 sec
Reputation Power: 0
Send a message via MSN to yoov
Thumbs up Solved

Hello all,

Thanks to all who tried helping, but I found the mystake I made!

i should have used objRecurPatt.parent.update instead of Appointment.update



Thank you

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Need help updating outlook appointment using vbs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway