Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
155 views
in Technique[技术] by (71.8m points)

javascript - 如何使用Microsoft API在embed或iframe标签中打开Excel或Word文件?(How to open Excel or Word file in embed or iframe tag using Microsoft API?)

I have input file tag, and I want to let user to choose Word file or Excel file, and open Microsoft Office in embed or iframe tag and let user edit it and after finishing download it as Excel or Word file also.

(我有输入文件标签,我想让用户选择Word文件或Excel文件,然后在embed或iframe标签中打开Microsoft Office,让用户对其进行编辑,并在完成下载后也将其另存为Excel或Word文件。)

I've heard that there is something called Microsoft API,but I didn't know how to deal with it.

(我听说有一种叫做Microsoft API的东西,但是我不知道如何处理它。)

This is what I've tried, but it's only a viewer not a editor, and I can't choose file from input file.

(这是我尝试过的方法,但是它只是查看器而不是编辑器,因此我无法从输入文件中选择文件。)

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>

   <input type="file" id="fileToUpload" />

   <iframe src='https://view.officeapps.live.com/op/embed.aspx? 
   src=http://www.learningaboutelectronics.com/Articles/Example.xlsx' 
   width='100%' height='565px' frameborder='0'> </iframe>

</body>
</html>
  ask by adelkanso translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...