Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Javascript to Open Outlook

Avatar

23-11-2008

Hi

Please help me.

I have a Javascript code saved as a .js which runs fine in Windows but when add this script to a button in Livecycle and publish the form it does not run. Basically the javascript opens an Outlook meeting request. What am I doing wrong? My code is below:



function objappt(Subject, Start, Location, End, RequiredAttendees, Body) {

}



var objOL //As Outlook.Application;

var objAppt //As Outlook.AppointmentItem;

var olAppointmentItem = 1;

var olMeeting = 1;



objOL = new ActiveXObject("Outlook.Application");

objappt = objOL.CreateItem(olAppointmentItem);

// With objappt;

objappt.Subject = "My Test Appointment";

objappt.Start = "11/23/2008 9:00 AM";

objappt.End = "11/23/2008 9:45 AM";

// make it a meeting request;

objappt.MeetingStatus = olMeeting;

objappt.Location = "NSW";

objappt.Body = "Testing";

objappt.RequiredAttendees = "someone@somewhere.dom";

objappt.Display();

// End With;



objAppt = null;

objOL = null

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

23-11-2008

Acrobat/Reader security will not allow javascript to create a new ActiveXObject. Acrobat runs in a sandbox and those objects exist outside of the sand box

Avatar

23-11-2008

Thanks Paul, that makes sense.

Can I then have a button on the form which when clicked runs an external .js script which will execute the ActiveXObject command?

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

24-11-2008

You cannot get to the outside world period. You are running in a sandbox and access to the outside world is restricted.

Avatar

24-11-2008

Ok, thanks Paul. Is there a way perhaps then to extract data in the PDF form via a 3rd party app or alternatively create a web page from the pdf with the info?

Thanks

Avatar

Avatar
Boost 1
Level 2
Luigi_247_365
Level 2

Likes

2 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 2
Luigi_247_365
Level 2

Likes

2 likes

Total Posts

26 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
Luigi_247_365
Level 2

25-11-2008

Amax...

if you want any exiciting things to happen with the PDF document.. then reader extend to enable the functionality.



use a reader extended pdf to make a webservice call or something like that.



Or you can use a submit button to send the data as XML / URL post!