Skip to main content
Inspiring
April 26, 2016
Answered

as3 code open microsoft outlook . is that possible

  • April 26, 2016
  • 3 replies
  • 670 views

i need simple as3 code that can open microsoft outlook. once i click the flash button it should navigate me to microsoft outlook .

note : i do not want to load microsoft out look in flash stage . rather once i click a button of .swf stage . then it will open microsoft out look of my windows 7

Any suggestion ?

thanks

This topic has been closed for replies.
Correct answer dmennenoh

import flash.filesystem.File;

import flash.desktop.NativeProcess;

import flash.desktop.NativeProcessStartupInfo;

var process:NativeProcess = new NativeProcess();

var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();

var exe:File = new File();

exe.nativePath = "C:/Program Files/Microsoft Office/Office15/Outlook.exe";

nativeProcessStartupInfo.executable = exe;

var args:Vector.<String> = new Vector.<String>();

args.push('/sniff');

nativeProcessStartupInfo.arguments = args;

process.addEventListener(NativeProcessExitEvent.EXIT, appClosed);

   

//start the process

process.start(nativeProcessStartupInfo);

function appClosed(e:NativeProcessExitEvent):void

{

  process.removeEventListener(NativeProcessExitEvent.EXIT, appClosed);

  trace("closed");

}

Here's a little code that will open Outlook on my machine. The args let you send command line switches, like /sniff which forces outlook to update meeting requests and such. You will need to publish to AIR and use the Extended Desktop profile.

3 replies

dmennenohCorrect answer
Inspiring
April 27, 2016

import flash.filesystem.File;

import flash.desktop.NativeProcess;

import flash.desktop.NativeProcessStartupInfo;

var process:NativeProcess = new NativeProcess();

var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();

var exe:File = new File();

exe.nativePath = "C:/Program Files/Microsoft Office/Office15/Outlook.exe";

nativeProcessStartupInfo.executable = exe;

var args:Vector.<String> = new Vector.<String>();

args.push('/sniff');

nativeProcessStartupInfo.arguments = args;

process.addEventListener(NativeProcessExitEvent.EXIT, appClosed);

   

//start the process

process.start(nativeProcessStartupInfo);

function appClosed(e:NativeProcessExitEvent):void

{

  process.removeEventListener(NativeProcessExitEvent.EXIT, appClosed);

  trace("closed");

}

Here's a little code that will open Outlook on my machine. The args let you send command line switches, like /sniff which forces outlook to update meeting requests and such. You will need to publish to AIR and use the Extended Desktop profile.

Inspiring
April 27, 2016

sorry an error occured

The application cannot be installed due to a certificate problem.  The certificate does not match the installed application certificate, does not support application upgrades, or is invalid.  Please contact the application author.

Inspiring
April 27, 2016

As long as you're running on AIR you can open anything you like.

Ned Murphy
Legend
April 27, 2016

Have you tried using a mailto link (URLRequest) such that the default browser opens?

I don't think there is any way you can target a specific application to open on someone's machine using AS3... that would be the equivalent of a nasty viral infestation if you could do that.