Save email to outlook folder using ActiveXObject or Office Javascript API? - javascript

In outlook, there is a feature “Home page address” of folder through which we can view web site within the outlook. If we set http://app.abctest.com in the Home page address of a folder, then when we click this folder in the outlook, it will display that page.
I have a very specific requirement for enabling end user to browse a web site (in my case, it basically lists some archived emails) within from the Outlook. This can be easily done by setting the “Home page address” in the properties windows of any Folder of Outlook.
The user will see the page within outlook. He can search the old archived emails in the page. Then, the users should be able to download that email and save it to a folder in outlook. End users are basically searching the emails within outlook and downloading them from the server directly to their outlook folder. When user click the download\save link or button, then the outlook’s “Select Folder” dialog should appear where user can select the destination folder. When user click “OK” button, that email should be save to the selected folder in the outlook.
Currently, I have very few solutions but not sure if they can achieve the goal.
Solution 1: ActiveXObject
I tried to use Outlook ActiveXObject in javascript (used the following code in my test page) but I got the following Script error Popup message.
“Automation server cannot create the object”.
Javascript code:
var objO = new ActiveXObject('Outlook.Application');
Solution 2: Javascript API for Office
I have started to read the MSDN documentation https://msdn.microsoft.com/en-us/library/office/fp142185.aspx but have not got any sample code.
Could someone please sheds some light on it? Or what would be the best solution for this? Or any alternative solution.

Prakash,
Only one instance of Outlook can be run at the same time. Try to use the GetObject function instead to get the running Outlook instance instead. See How to programmatically create an Outlook home folder page in the Outlook Today style for more information. However, home page scripting is limited and secured to prevent malicious software. I'd suggest developing an add-in which can add a custom form instead.
The second solution listed above is for Mail Apps. See How to: Create your first mail app for Outlook by using Visual Studio for more information.

When your script runs inside a folder home page, window.external.OutlookApplication will point to an instance off the Outlook.Application object - your should be able to use it without creating a new object.

Related

Launch a selenium webdriver from within a browser extension?

In a nutshell, I want to build a chrome extension that collects all data properties of an ad listing (e.g. title, description, photos etc.) that's open in one tab, then maps these to fields on a different site (to be opened in a headless browser) and submit the newly created listing. Basically, automate listing submission to multiple sites.
Now, opening the source url and crawling for the data won't be an issue. But how do I (headlessly in the background) populate and submit the target form, with the photo upload being implemented in js being the trickiest part.
So how do I go about this? Would it be possible to bundle and launch a selenium webdriver from within the background script at all or I should look into a completely different direction?
Many thanks for any tips you might have!

Adding an attachment to default email client from client side

I tried to create a new mail with an attachment using mailto. It is opening a new mail window in Outlook 2010 but without attachment. While investigating the issue I understood that it is impossible to achieve using mailto. Is there any other way to achieve it? I researched about it but I couldn't find anything useful.
In Java Script?
If you are running inside IE from a trusted site, you can create an instance of the Outlook.Application COM object and use OOM to create a message with attachments.
You can programmatically build an EML (MIME) file that includes HTML body and attachments and let user download that file. Outlook will be happy to open an EML and display it to an end user.

How to connect to outlook from browser (internet explorer)

So this is what I need for my customer
From my secure intranet webapplication the user can select several files. Somehow (browser plugin/add-on, JavaScript, whatever) the user can start outlook to compose a new mail. The selected files have to be attached to the composed mail. To make things even more interesting, the filenames of the attached files have to be altered (the file version has to be added to the filename).
It must work with Outlook 2013 and Internet Explorer 11.
I don't want the mail to be created in the browser and then be send from the server, since I want the user to have full control on the composed mail and have them use all the features of Outlook.
What would be the right technique(s) to accomplish this?
Dynamically create an EML file (MIME) and give the user a link to it. Outlook will be able to open the message with the HTM body, recipients, attachments, etc. prepopulated.
Try to use this into your javascript
mailto:email#domain.com?subject=file&body=P.F.A&attachment='filepath/filename.extention'

How to Prevent Authentication for Specific Sharepoint Page

I would like to set our user's Microsoft Outlook Home Page to point to our intranet news page(hosted on Sharepoint).
I finally managed to suppress some JS errors I was getting when trying this (See this question).
However, when users access this homepage through outlook, they are asked to provide their Sharepoint credentials. They are then not required to do so for the next 24 hours. The next morning, they will be asked to provide credentials again.
Is anyone aware of a way around this, perhaps by embedding a script into the page or by setting some specific page permissions? Usually, the user can access the site without having to log in if they navigate via IE, so why does this not carry over to the Outlook web browser?
Any help or guidance is much appreciated.
Many thanks
Have you push down the GPO Settings for IE Settings - Trusted Intranet Zone?
Another way is to turn on Anonymous Access to your portal. See link
to solve this problem I changed my approach completely.
Instead of linking to the web page directly in Outlook I created scheduled task which queries the SharePoint server for the news article data, and then builds an HTML page with the 10 latest articles.
This task runs hourly and the HTML file is linked to on each user's Outlook homepage.
If anyone would like to see the code I use to achieve this please efelf ree to message me.

open Camera Roll from Java Script method in iOS

I have requirement to load one JSP/HTML5 page in UIWebView. In this page there is link for attachment and on click of that I need to open CameraRoll to select file and then upload it to server. This is same like we do attachment in email. Now problem is from Java Script how do I open CameraRoll? My main query is that is it possible to open CameraRoll from Java Script without calling Native iOS methods. Java Script to open dialog is embedded in JSP/HTML5 page.
Let me know if you find that above information is not enough so I will try to give you more detail. Ultimately I have one page in UIWebView which should work like sending some message to user with attachment from CameraRoll like we do in normal email app.
I searched a lot on net but couldnt find any help on this.
Starting in iOS6, you can access the Media Capture API which allows you to request files from the user via <input type="file" />.
Essentially, all you need to do is include an <input type="file" /> and when the user touches the input, it will open the phone's camera roll.
Once the user has selected the file, you can send the file using the POST form action or AJAX, or use the File API to manipulate the file data on the client side. Check out the HTML Media Capture specification from the W3C for more information on implemention.

Categories

Resources