Fetstil Fetstil Kursiv Understrykning linje färgläggning tabellverk Punktlista Nummerlista Vänster Centrerat högerställt Utfyllt Länk Bild htmlmode
  • Forum & Blog
    • Forum - översikt
      • .Net
        • asp.net generellt
        • c#
        • vb.net
        • f#
        • silverlight
        • microsoft surface
        • visual studio .net
      • databaser
        • sql-server
        • databaser
        • access
        • mysql
      • mjukvara klient
        • datorer och komponenter
        • nätverk, lan/wan
        • operativsystem
        • programvaror
        • säkerhet, inställningar
        • windows server
        • allmänt
        • crystal reports
        • exchange/outlook
        • microsoft office
      • mjukvara server
        • active directory
        • biztalk
        • exchange
        • linux
        • sharepoint
        • webbservers
        • sql server
      • appar (win/mobil)
      • programspråk
        • c++
        • delphi
        • java
        • quick basic
        • visual basic
      • scripting
        • asp 3.0
        • flash actionscript
        • html css
        • javascript
        • php
        • regular expresssion
        • xml
      • spel och grafik
        • DirectX
        • Spel och grafik
      • ledning
        • Arkitektur
        • Systemutveckling
        • krav och test
        • projektledning
        • ledningsfrågor
      • vb-sektioner
        • activeX
        • windows api
        • elektronik
        • internet
        • komponenter
        • nätverk
        • operativsystem
      • övriga forum
        • arbete karriär
        • erbjuda uppdrag och tjänster
        • juridiska frågor
        • köp och sälj
        • matematik och fysik
        • intern information
        • skrivklåda
        • webb-operatörer
    • Posta inlägg i forumet
    • Chatta med andra
  • Konto
    • Medlemssida
    • Byta lösenord
    • Bli bonsumedlem
    • iMail
  • Material
    • Tips & tricks
    • Artiklar
    • Programarkiv
  • JOBB
  • Student
    • Studentlicenser
  • KONTAKT
    • Om pellesoft
    • Grundare
    • Kontakta oss
    • Annonsering
    • Partners
    • Felanmälan
  • Logga in

Hem / Tips & tricks

#1907 - Hämta alla bokningar i kalendern

Postat 2004-10-27 13:11:24 av Pelle Johansson i Kategori Programmering, C#, Kommandon med 0 Kommentarer

Sub GetAppointments()

Dim myApp As New Outlook.Application
Dim myNS As NameSpace
Dim myFolder As MAPIFolder 'Outlooks MAPI folders e.g. Inbox, Contacts, Calendar
Dim myItems As Items 'each mail item
Dim MyItem As AppointmentItem 'for the individual appointments
Dim intLoopCounter As Integer, intBusy As Integer

Set myNS = myApp.GetNamespace("MAPI") 'get a namespace for the data items in the MAPI
Set myFolder = myNS.GetDefaultFolder(olFolderCalendar) 'set the folder as the calendar
Set myItems = myFolder.Items ' set the myItems to be each of the appointments in the calendar data space

For intLoopCounter = 2 To myItems.Count ' Loop through all the appointments in the calendar
' We could have a line in her to check if the appointment is past a certain date and only return such items e.g.
' If myItems(intLoopCounter).Start > "Date" then
Range("a" & intLoopCounter).Value = myItems(intLoopCounter).Subject ' set the value of the cell A and the loop position to the subject of the appointment
Range("b" & intLoopCounter).Value = myItems(intLoopCounter).Start ' set the value of the cell B and the loop position to the start date/time value of the appointment
Range("c" & intLoopCounter).Value = myItems(intLoopCounter).End ' set the value of the cell C and the loop position to the end date/time of the appointment
Select Case myItems(intLoopCounter).BusyStatus ' now we need to know what the value of the status is using the select case of the .BusyStatus
Case 0
Range("d" & intLoopCounter).Value = "Free" ' and depending on its value, write this to the cell D and the loop position
Case 1
Range("d" & intLoopCounter).Value = "Tentative"
Case 2
Range("d" & intLoopCounter).Value = "Busy"
Case 3
Range("d" & intLoopCounter).Value = "Out of Office"
End Select
Range("e" & intLoopCounter).Value = myItems(intLoopCounter).Location ' set the value of the cell E and the loop position to the Location of the appointment
' End If '- uncomment this line if you are using the date check line above
Next intLoopCounter ' Iterate through to the next appointment item

Set myNS = Nothing ' always clear up after!
Set myFolder = Nothing
Set myItems = Nothing
Set MyItem = Nothing

End Sub

Sample:
Size:

Nyligen

  • 19:55 kick-off med fokus på hälsa?
  • 19:53 kick-off med fokus på hälsa?
  • 16:24 Föreslå en skönhetsklinik online
  • 16:23 Föreslå en skönhetsklinik online
  • 18:42 Hvor finder man håndlavede lamper
  • 18:41 Hvor finder man håndlavede lamper
  • 16:36 Allt du behöver veta om keramiskt
  • 16:14 Vem anlitar man egentligen när tak

Sidor

  • Hem
  • Bli bonusmedlem
  • Läs artiklar
  • Chatta med andra
  • Sök och erbjud jobb
  • Kontakta oss
  • Studentlicenser
  • Skriv en artikel

Statistik

Antal besökare:
Antal medlemmar:
Antal inlägg:
Online:
På chatten:
4 570 722
27 958
271 751
733
0

Kontakta oss

Frågor runt konsultation, rådgivning, uppdrag, rekrytering, annonsering och övriga ärenden. Ring: 0730-88 22 24 | pelle@pellesoft.se

© 1986-2013 PelleSoft AB. Last Build 4.1.7169.18070 (2019-08-18 10:02:21) 4.0.30319.42000
  • Om
  • Kontakta
  • Regler
  • Cookies