writing appointment

Discussion in 'Questions (Windows Mobile)' started by paul j, Sep 23, 2007.

  1. paul j

    paul j Member Licensed User

    Tried to write an appointment into both PPC-outlook aswell Desktop-outlook.
    Used the example code and added the newes DLL's to the project. Can't findback the results in outlook. There are no error-messages. What can be wrong:confused:
     
    Last edited: Sep 23, 2007
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you show your code?
     
  3. paul j

    paul j Member Licensed User

    i started with:
    Appointment.new1
    Appointment.Subject = aSubject
    Appointment.Start = DateParse("10/25/2007") + (TimeParse("13:35") Mod cTicksPerDay)
    PimCollection.AddItem(appointment.New1)

    now i have the code, stille without results
    Appointment.new1
    PimCollection.New1("Appointments")
    Appointment.New1
    Appointment.Subject = aSubject
    Appointment.AllDayEvent = true
    Appointment.Start = DateParse(aDate)
    PimCollection.AddItem(appointment.New1)
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You should change this line:
    PimCollection.AddItem(appointment.New1)
    to:
    PimCollection.AddItem(appointment.Value)
     
  5. paul j

    paul j Member Licensed User

    Hi Erel,

    I Already found the change you mentioned, but stil without resuls. I looked into the watch and found for the date(appointment.start.value) = 01/01/0001. I don't think I want an appointment in this year. Value for appointment.Subject = 0

    all this with the code :

    adate = "02/17/2007"
    aSubject = "test"

    Appointment.new1
    Appointment.CreateNew
    Appointment.Subject = aSubject
    Appointment.AllDayEvent = true
    Appointment.Start = DateParse(aDate)
    PimCollection.New1("Appointments")
    PimCollection.AddItem(appointment.value)
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    I've checked your code and it works fine.
    You should check Date(Appointment.Start) (without the 'value').
    If it still doesn't work please upload your code.
     
  7. paul j

    paul j Member Licensed User

    Hi Erl,
    I think I have to experiment with the dateformat. Normaly in the Netherlands we use dd-mm-yyyy. In the debugger yhe dateparse gives back a 0(zero) withe the format mm/dd/yyyy is returns a proper count of ticks

    Sub Globals
    DateFormat("dd-mm-yyyyy")
    End Sub

    Sub App_Start
    frmMain.show

    End Sub


    Sub GetDate
    Dim Date, subject

    NewDate ="17/10/2007"
    subject = "test"

    AddAppointment(NewDate,subject)

    End Sub

    Sub AddAppointment(aDate, aSubject)
    'pre aDate and aSubject have correct values
    'post event has been added into the calender

    Appointment.new1
    Appointment.CreateNew
    Appointment.Subject = aSubject
    Appointment.AllDayEvent = true
    Appointment.Start = DateParse(aDate)
    PimCollection.New1("Appointments")
    PimCollection.AddItem(appointment.value)
    Msgbox(PimCollection.Count)

    End Sub
     
    Last edited: Sep 24, 2007
  8. Erel

    Erel Administrator Staff Member Licensed User

  9. paul j

    paul j Member Licensed User

    Hi Erel,

    it seems the Outlook objects doesn't accept te parameters. I tried several formats/system settings on mu Desktop and formatsettings in the code, but with the debugger the content of Appointment.start is always 01/01/0001 or 0 (zero) depending of the used formats and the PimAppointment.count is always 0 (zero). Scubaticus (another Dutch-user) and I have simulair problems with the system-settings and b4ppc combination.
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    The Outlook library is only supported on the device.
    The OutlookDesktop.dll file is only a "dummy" library to allow you to write your code on the desktop.
    You should test it on the device.
     
Loading...