设置个人/公共视图
View.IsPersonal
说明
可读写 设置视图为个人视图或公共视图
返回值
Boolean
浏览器环境示例
javascript
async function getPublicView() {
await instance.ready();
const app = instance.Application;
const view = await app.Sheets(1).Views(1);
const isPersonal = await view.IsPersonal; // 若为个人视图返回true,若不为公共视图返回false
return !isPersonal;
}
async function setPublicView() {
await instance.ready();
const app = instance.Application;
const view = await app.Sheets(1).Views(1);
view.IsPersonal = false; // 设置为公共视图
view.IsPersonal = true; // 设置为个人视图
}
脚本编辑器 示例
javascript
function main() {
const view = Application.Sheets(1).Views(1);
const isPublicView = !view.IsPersonal;
view.IsPersonal = false; // 设置为公共视图
view.IsPersonal = true; // 设置为个人视图
}
main()