Solved

Open External Files Using UNC Path via a Button Using JScript

Posted on 2011-09-21
2
332 Views
Last Modified: 2012-08-13
Hello Experts,

Without getting into too much detail I need to use JScript to open some .xls & .mdb files via buttons within an InfoPath 2003 form.  I know how to accomplish this using vbs but obviously I can't do that now.  Aside from suggesting using a link; does anyone know how to accomplish this with js?

Thanks
0
Comment
Question by:ShadowIT
  • 2
2 Comments
 

Accepted Solution

by:
ShadowIT earned 0 total points
ID: 36587281
I figured this out myself, here's the code in case anyone else needs it.  It works for both UNC paths and URLs (be sure to add extra "\'):

}

p.s. for UNC path {
var Act = new ActiveXObject("Wscript.Shell");
 var File = ("\\\\Your\\file\\here");  
  try {Act.Run("\""+File+"\"",1,false);}
  catch(e){ Act.Popup("" +'\n'+ File, 0,"", 0 + 0 + 0);}
}
0
 

Author Closing Comment

by:ShadowIT
ID: 36587284
I answered the quesiton myself, please refund my points.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Before you can digitally sign infopath forms, you must have a digital certificate. Microsoft Certificate Services will need to be enabled on a Windows Server 2008 to facilitate the creation and verification of the digital certifciates on the web ser…
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now