1
我在谷歌表這個腳本運行的腳本,我希望它運行時電池A6變爲「接受」我必須這樣做,因爲谷歌表不使用平板電腦時,顯示圖紙。如何當細胞是變化
我發現它開始與function onOpen(e)
有人知道如何做到這一點?
我的代碼:
function Melding() {
var email = Session.getActiveUser().getEmail();
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var cell = ss.getActiveCell().getA1Notation();
var row = sheet.getActiveRange().getRow();
var cellvalue = ss.getActiveCell().getValue().toString();
var recipients = sheet.getRange(7, 7).getValue();
var message = '';
}
var subject = 'Update : '+sheet.getRange(4, 2).getValue();
var body = 'text ' + sheet.getRange(4, 2).getValue() + ' text. ' + '\n' + '\nFølg link for å se endringer : ' + ss.getUrl() + '\n' + '\n' + 'text : ' + '\n' + '" ' + sheet.getRange(6, 7).getValue() + ' " ' + '\n ' + '\n (Google) ' + '\n' + '\n - VS ' + message +'';
MailApp.sendEmail(recipients, subject, body);
var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1');
sheet.getRange('G6').setValue('No MSG');
Browser.msgBox('Takk for det' , 'MSG sent to : '+sheet.getRange(7, 7).getValue()+ '\n' + ' - (From : '+email+')', Browser.Buttons.OK);
您好,感謝。 它看起來像代碼不工作?我必須添加觸發器嗎? '函數onEdit(E){ VAR片= ss.getSheetByName( 'Sheet 1中'); 如果(e.range.getA1Notation()== 'A6' || e.value == '接受'!)回報; Melding() }' –
我看你嘗試登錄當前用戶。如果你想爲'其他'用戶這樣做,他們必須先授權腳本。你能否分享一份電子表格的副本,以便我可以嘗試優化代碼? – JPV
嗨,我不需要登錄當前用戶。這張紙是挪威的。即使您是匿名用戶,是否可以通過腳本從我的郵件發送電子郵件?請點擊此鏈接:https://docs.google.com/spreadsheets/d/1U0RgwZCm-H4o-tkvERicaYBMuZ8dxty7OhlYlRpHzdM/edit?usp=sharing –