mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Update msoffice.js
This commit is contained in:
parent
b391867f14
commit
aa8f10b6a7
|
@ -120,9 +120,6 @@ function PowerPoint() {
|
|||
this.currentPresentation = null;
|
||||
|
||||
this.open = function(filename) {
|
||||
console.log("test");
|
||||
console.log(typeof filename);
|
||||
|
||||
if (typeof filename !== "undefined") {
|
||||
// check type of the path
|
||||
if (filename.indexOf(":\\") < 0 && filename.indexOf(":/") < 0) {
|
||||
|
@ -139,17 +136,39 @@ function PowerPoint() {
|
|||
} else {
|
||||
this.currentPresentation = this.application.Presentations.Add(true);
|
||||
}
|
||||
//this.selectPresentation(1);
|
||||
};
|
||||
|
||||
this.selectPresentation = function(idx) {
|
||||
if (idx == 0) {
|
||||
this.currentWorksheet = this.application.ActivePresentation;
|
||||
this.currentPresentation = this.application.ActivePresentation;
|
||||
} else {
|
||||
this.currentWorksheet = this.application.Presentations(idx);
|
||||
this.currentPresentation = this.application.Presentations(idx);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
this.saveAs = function(filename) {
|
||||
try {
|
||||
this.currentPresentation.saveAs(filename);
|
||||
return FILE.fileExists(filename);
|
||||
} catch (e) {
|
||||
console.error("Could not save a file:", e.message);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
this.close = function() {
|
||||
try {
|
||||
this.currentPresentation.Close()
|
||||
this.currentPresentation = null;
|
||||
this.application = null;
|
||||
} catch (e) {
|
||||
this.currentPresentation = null;
|
||||
this.application = null;
|
||||
}
|
||||
};
|
||||
|
||||
// get all slides
|
||||
this.getSlides = function() {
|
||||
var slides = [];
|
||||
|
|
Loading…
Reference in New Issue
Block a user