Google Apps脚本-创建日历事件 [英] Google Apps Script - Creating Calendar Events

查看:142
本文介绍了Google Apps脚本-创建日历事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建日历事件时,我可以根据单元格的内容设置创建事件后出现的CREATED BY字段(由于电子邮件是公共表格,因此将手动输入电子邮件地址) ,该单元格将为"D2")

When creating a Calendar event is it possible for me to set the CREATED BY field, that appears once the event is created, based on the contents of a cell (e-mail addresses will be entered manually as it is a public form, the cell will be "D2")

这是我目前拥有的:

function CreateEvent() {
var vSS = SpreadsheetApp.getActiveSpreadsheet();
var vS = vSS.getActiveSheet();  
var vStartDate = vS.getRange("B2").getValue();
var vEndDate = vS.getRange("C2").getValue();  
var calendar = CalendarApp.getCalendarById(
 'blahblah.com_79u2vjeeepkpra94hp12nbscc0@group.calendar.google.com');
var event =  calendar.createEvent('Apollo 11 Landing',
 new Date(vStartDate),
 new Date(vEndDate));
Logger.log('Event ID: ' + event.getId());
}

推荐答案

CREATED BY字段将始终显示创建活动的人的姓名(或电子邮件)...您是否真的想对此作弊?显示别人的名字?

The CREATED BY field will always show the name (or email) of the person who created the event... are you really wanting to cheat on this and show someone else's name ?

这篇关于Google Apps脚本-创建日历事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆