`

js 打开ppt

阅读更多
Open(FileName, ReadOnly, Untitled, WithWindow)
Open2007(FileName, ReadOnly, Untitled, WithWindow, OpenAndRepair)


function ConvertPPT2MHT(file)
{
  var PPT = new ActiveXObject("PowerPoint.Application");
  var Pres = PPT.Presentations.Open(file, false, false, false);
  Pres.SaveAs(target_htm_file, 12, false);
  Pres.Close();
}


JS实现在线修改服务端office文档 
<script language="javascript" type="text/javascript">
function openfile(path)
{
     var exName=path.substr(path.lastIndexOf(".")+1).toLowerCase();
var fName=path.substr(path.lastIndexOf("\\")+1).toLowerCase();
if (exName=="doc")
{
      var word;
         word = new ActiveXObject("Word.Application");
      word.Visible = true;
         word.Documents.Open(path,true,false);
  word.Application.Activate();
  word.WindowState = 1;
  return;
}
if (exName=="xls")
{
  var excel;
  excel=new ActiveXObject("Excel.Application");
  excel.Visible=true;
  excel.Workbooks.Open(path,true,false);
  excel.WindowState = 1;
  return;
}
if (exName=="ppt")
{
  var powerpoint;
  powerpoint=new ActiveXObject("PowerPoint.Application");
  alert(powerpoint);
  powerpoint.Visible=true;
  powerpoint.Presentations.Open(path,true,false);
  return;
 
}
}
</script>  


excel.application的WorkBooks的方法:


work.Document方法:



Open(FileName, ReadOnly, Untitled, WithWindow)
Open2007(FileName, ReadOnly, Untitled, WithWindow, OpenAndRepair)


function ConvertPPT2MHT(file)
{
  var PPT = new ActiveXObject("PowerPoint.Application");
  var Pres = PPT.Presentations.Open(file, false, false, false);
  Pres.SaveAs(target_htm_file, 12, false);
  Pres.Close();
}


JS实现在线修改服务端office文档 
<script language="javascript" type="text/javascript">
function openfile(path)
{
     var exName=path.substr(path.lastIndexOf(".")+1).toLowerCase();
var fName=path.substr(path.lastIndexOf("\\")+1).toLowerCase();
if (exName=="doc")
{
      var word;
         word = new ActiveXObject("Word.Application");
      word.Visible = true;
         word.Documents.Open(path,true,false);
  word.Application.Activate();
  word.WindowState = 1;
  return;
}
if (exName=="xls")
{
  var excel;
  excel=new ActiveXObject("Excel.Application");
  excel.Visible=true;
  excel.Workbooks.Open(path,true,false);
  excel.WindowState = 1;
  return;
}
if (exName=="ppt")
{
  var powerpoint;
  powerpoint=new ActiveXObject("PowerPoint.Application");
  alert(powerpoint);
  powerpoint.Visible=true;
  powerpoint.Presentations.Open(path,true,false);
  return;
 
}
}
</script>  


excel.application的WorkBooks的方法:


work.Document方法:

ppt.presentations方法
Presentations.Open 方法


Function Open(FileName As String,              [Password As VARIANT],              [ReadOnly As KsoTriState = 0],              [Untitled As KsoTriState = 0],              [WithWindow As KsoTriState = -1]) As Presentation参数说明
FileName
String 类型,必需。表示要打开的演示文稿的名称。

Password
String 类型,可选。表示打开指定的演示文稿需要指定的密码。

ReadOnly
KsoTriState 类型,可选。表示是否以只读方式打开指定的演示文稿。

Untitled
KsoTriState 类型,可选。表示打开的演示文稿是否为无标题。

WithWindow
KsoTriState 类型,可选。表示打开的演示文稿是否可见。

返回值

Presentation 对象
  • 大小: 81 KB
  • 大小: 107.3 KB
  • 大小: 69.1 KB
  • 大小: 69.1 KB
分享到:
评论
1 楼 bommeibo 2013-03-15  
好文章..

相关推荐

Global site tag (gtag.js) - Google Analytics