function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbanteAbante 

VF Page - Javascript Button

Hello everyone!

 

We have a custom field (path__c) with the URL of a file stored in our local server. Now we want to put a button in the layout with a very simple VF Page

 

<apex:page standardController="Account" >
<html>
<head>
<script type="text/javascript">
function startXL()
{
   var myApp = new ActiveXObject("Excel.Application");
   if (myApp != null)
   {
     myApp.visible = true;
     myApp.workbooks.open("file:///\\Abserver1{!Account.Path__c}");
   }
}
</script>
</head>
<body>
<input type="button" value="Open" onclick="startXL()"> 
</body>
</html>
</apex:page>

 

We want to click on It and open the file, we don't want to download the file.

 

Any advice?

 

Thank you