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的方法:
[img]http://dl.iteye.com/upload/attachment/241248/dfb9169f-10b1-39f9-bf02-cf8d3ec2b329.jpg[/img]

work.Document方法:
[img]http://dl.iteye.com/upload/attachment/241252/c409548f-9edf-3ba0-ac41-ffde4d7e9743.jpg[/img]


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的方法:
[img]http://dl.iteye.com/upload/attachment/241248/dfb9169f-10b1-39f9-bf02-cf8d3ec2b329.jpg[/img]

work.Document方法:
[img]http://dl.iteye.com/upload/attachment/241252/c409548f-9edf-3ba0-ac41-ffde4d7e9743.jpg[/img]
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 对象
[img]http://dl.iteye.com/upload/attachment/241260/46c4b546-e664-37c2-8e5f-2e45775c9e94.jpg[/img]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值