mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-08 12:46:05 +00:00
Update msoffice.js
This commit is contained in:
parent
b391867f14
commit
aa8f10b6a7
|
@ -120,9 +120,6 @@ function PowerPoint() {
|
||||||
this.currentPresentation = null;
|
this.currentPresentation = null;
|
||||||
|
|
||||||
this.open = function(filename) {
|
this.open = function(filename) {
|
||||||
console.log("test");
|
|
||||||
console.log(typeof filename);
|
|
||||||
|
|
||||||
if (typeof filename !== "undefined") {
|
if (typeof filename !== "undefined") {
|
||||||
// check type of the path
|
// check type of the path
|
||||||
if (filename.indexOf(":\\") < 0 && filename.indexOf(":/") < 0) {
|
if (filename.indexOf(":\\") < 0 && filename.indexOf(":/") < 0) {
|
||||||
|
@ -139,17 +136,39 @@ function PowerPoint() {
|
||||||
} else {
|
} else {
|
||||||
this.currentPresentation = this.application.Presentations.Add(true);
|
this.currentPresentation = this.application.Presentations.Add(true);
|
||||||
}
|
}
|
||||||
|
//this.selectPresentation(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.selectPresentation = function(idx) {
|
this.selectPresentation = function(idx) {
|
||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
this.currentWorksheet = this.application.ActivePresentation;
|
this.currentPresentation = this.application.ActivePresentation;
|
||||||
} else {
|
} else {
|
||||||
this.currentWorksheet = this.application.Presentations(idx);
|
this.currentPresentation = this.application.Presentations(idx);
|
||||||
}
|
}
|
||||||
return this;
|
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
|
// get all slides
|
||||||
this.getSlides = function() {
|
this.getSlides = function() {
|
||||||
var slides = [];
|
var slides = [];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user