How to create an outlook appointment item using Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirajzambad
    New Member
    • Jul 2015
    • 4

    How to create an outlook appointment item using Javascript

    Hi All,

    How to create an outlook appointment item using Javascript
    with a body containing hyperlink as follows:
    <a href="#">My Link</a>.

    Please tell me ASAP.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    not at all. JavaScript does not have Outlook bindings.

    it may work in IE since you can use ActiveX controls there, but that's JScript, not JavaScript. You’ll find the appropriate documentation on the MSDN website.

    Comment

    • nirajzambad
      New Member
      • Jul 2015
      • 4

      #3
      I am using Active x object. But not able to put a link in a body section. Can you please tell me how could i do this?

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        Code:
        document.body.innerHTML = "your html code here";

        Comment

        • nirajzambad
          New Member
          • Jul 2015
          • 4

          #5
          Can you please elaborate in detail, how to do this?

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            how to do what?

            Comment

            • nirajzambad
              New Member
              • Jul 2015
              • 4

              #7
              ok, this is my code

              Code:
              function AddCalendarAppointment(appointmentSubject,appointmentBody,travelLocation,departDate,returnDate) {
              
                outlookApp = new ActiveXObject("Outlook.Application");
                nameSpace = outlookApp.getNameSpace("MAPI");
                // Get a handle of the Calendar folder
                apptFolder = nameSpace.getDefaultFolder(9);
              
                // Create a new Appointment item and fill it in
                apptItem = apptFolder.Items.add("IPM.Appointment");
                //alert('hi');
                
                //alert('hi');
                apptItem.Subject = 'Check-In Conversation with <INSERT YOUR NAME HERE>';
                  apptItem.Location = '<INSERT LOCATION; AIM FOR LIVE CONVERSATION IF POSSIBLE>';  
                 apptItem.Body = 'I’d like to schedule a check-in conversation.';
                apptItem.Save();
                  
                //apptItem.ReminderSet = False;
                //apptItem.ReminderMinutesBeforeStart = 15
                //apptItem.BusyStatus = Outlook.OlBusyStatus.olOutOfOffice;
                //apptItem.AllDayEvent = true;
              
                // Show the new contact
                apptItem.Display(); // true = modal
              }
              I am able to add plain text but i also want to add a hyperlink like this <a href="#">HI</a> and it should only display Link with text OK in outlook appointment body.
              Please suggest me some way

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                glancing over https://msdn.microsoft.com/en-us/lib...ffice.12).aspx it doesn’t look like you can do what you want.

                essentially, your appointment object is a .NET object, not a JavaScript object and you’re actually using IE’s .NET bindings. So the limitation comes from .NET.

                however, you could ask at MSDN or in the .NET forums if someone knows how to create links in an appointment object.

                Comment

                Working...