Announcement

Collapse
No announcement yet.

MS Outlook Calendar. How to update?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BOB MECHLER
    replied
    Thanks,

    I look forward to trying it out. It will give me an excuse to learn some of the v 9 features with something practical for me.

    Bob Mechler

    Leave a comment:


  • Neil J Hosgood
    replied
    Hi BOB,
    If you have not sorted this already here is some code pulled from an app of mine. compiled with PB8 so uses dispatch, have converted to use PB9 dispatch.

    N.

    Code:
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "win32api.inc"
    #INCLUDE "outlookdispatch.inc"
    
    
    FUNCTION CreateAPPT(sSubj AS STRING, sLoc AS STRING, sBody AS STRING, sStart AS STRING, sEndTime AS STRING) AS LONG
      LOCAL ProgID_OutlookApplication   AS STRING
      LOCAL Outlook                     AS Int__Application
      LOCAL OlNS                        AS INT__NameSpace
      LOCAL OutLookItem                 AS Int__AppointmentItem
      LOCAL olFolder                    AS MapiFolder
      LOCAL vSpace, olFolderCalendar    AS VARIANT
      LOCAL vType, vFolder              AS VARIANT
      LOCAL vFolderType, vItem          AS VARIANT
      LOCAL vSubject, vBody, vLocation  AS VARIANT
      LOCAL vStart, vEnd, vReminderSet  AS VARIANT
      LOCAL vReminderMinutesBeforeStart AS VARIANT
      LOCAL vBusyStatus, vAllDayEvent   AS VARIANT
      LOCAL vIsOnlineMeeting            AS VARIANT
    
      vSubject         = sSubj
      vBody            = sBody
      vLocation        = sLoc
      vStart           = sStart
      vEnd             = sEndTime
      vReminderSet     = %FALSE
      vBusyStatus      = %OlBusy
      vIsOnlineMeeting = %False
      vAllDayEvent     = %False
    
      ProgID_OutlookApplication = PROGID$(CLSID$("Outlook.Application"))
      IF LEN(ProgID_OutlookApplication) = 0 THEN ProgID_OutlookApplication = "Outlook.Application"
    
      SET Outlook = Int__Application IN ProgID_OutlookApplication
      IF ISFALSE ISOBJECT(Outlook) THEN _
        SET Outlook = NEW Int__Application IN ProgID_OutlookApplication
    
      IF ISFALSE ISOBJECT(Outlook) THEN
        MSGBOX "Unable to open or start Outlook!"
        EXIT FUNCTION
      END IF
    
      vType = "MAPI"
      OBJECT CALL Outlook.GetNameSpace(vType) TO vSpace
      SET OLns = vSpace
    
      OBJECT CALL OLns.Logon
    
      vFolderType = %olFoldercalendar
      OBJECT CALL OLns.GetDefaultFolder(vFolderType) TO vFolder
      SET olFolder = vFolder
    
    
      vType = %olappointmentItem
      OBJECT CALL Outlook.CreateItem(vType) TO vItem
      SET OutLookItem = vItem
    
      IF LEN(VARIANT$(vSubject))  THEN OBJECT LET OutLookItem.Subject = vSubject  'Create contact with contacts partial information.
      IF LEN(VARIANT$(vBody))     THEN OBJECT LET OutLookItem.Body = vBody
      IF LEN(VARIANT$(vLocation)) THEN OBJECT LET OutLookItem.Location = vLocation
      IF LEN(VARIANT$(vStart))    THEN OBJECT LET OutLookItem.Start = vStart
      IF LEN(VARIANT$(vEnd))      THEN OBJECT LET OutLookItem.END = vEnd
      OBJECT LET OutLookItem.ReminderSet = vReminderSet
    
      OBJECT CALL OutLookItem.Save
      OBJECT CALL OLns.Logoff
    
      SET Outlook     = NOTHING
      SET OLns        = NOTHING
      SET OutLookItem = NOTHING
      SET olFolder    = NOTHING
                                   
    END FUNCTION
    
    FUNCTION PBMAIN () AS LONG
       CALL CreateAppt("This is the subject", "This is the Location","and this is the body","12/05/2009 9:05 AM","12/05/2009 10:45 AM")
       MSGBOX "done"
    END FUNCTION

    Leave a comment:


  • BOB MECHLER
    started a topic MS Outlook Calendar. How to update?

    MS Outlook Calendar. How to update?

    I get a printed time sheet every day of phone calls made from my extension. I'd like to modify this program to send the information to a text file and then create a PB program that would read this file on the same workstation as my Outlook to fill in my MS Outlook Calendar with the start time, stop time and comments.

    Anyone done something like this?

    Bob Mechler
Working...
X