{"id":328575,"date":"2022-01-25T15:00:57","date_gmt":"2022-01-25T15:00:57","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=328575"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=328575","title":{"rendered":"<span>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 *.XLSX \u0432 Google Sheets<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p>&#171;\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u2014 \u0437\u0430\u043b\u043e\u0433 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438.&#187;<\/p>\n<\/blockquote>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c MS Excel \u0438 Google Docs, \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0430 VBA, App Script \u0438 JavaScript.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0430<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 *.XLSX \u0432 Google Sheets \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 VBA \u0438 App Script \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445(\u0433\u0440\u0430\u043d\u0438\u0446\u044b, \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435).<\/p>\n<p>\u0426\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Google Sheets \u0438\u0437 XLSX  \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 VBA \u0438 App Script.<\/p>\n<p>\u0412\u0441\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 VBA, App Script \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.\u00a0  <\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f, \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0438\u043c\u0435\u0435\u043c:<\/h2>\n<ul>\n<li>\n<p><strong>Microsoft<\/strong>\u00a0<strong>Excel<\/strong>  <\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0447\u0442\u0430\u0432\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430 Outlook<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0447\u0442\u0430<\/strong>\u00a0<strong>Gmail<\/strong>  <\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c:<\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 XLSX \u0432 Google Sheets \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 VBA \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0447\u0442\u043e\u0432\u0443\u044e \u0441\u043b\u0443\u0436\u0431\u0443 Outlook \u043d\u0430 \u0441\u0432\u043e\u044e \u043f\u043e\u0447\u0442\u0443 Gmail \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u0442\u043a\u043e\u0439, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e App Script \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Google Sheets \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442.<\/p>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u0440\u043e\u0440\u0435 VBA \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430 \u0441 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c:<\/p>\n<pre><code>Function SendEmailOutlook(ByVal Email$, ByVal MailText$, Optional ByVal Subject$ = \"\", _                                Optional ByVal AttachFilename As Variant) As Boolean     On Error Resume Next: Err.Clear     Dim OA As Object: Set OA = CreateObject(\"Outlook.Application\")     If OA Is Nothing Then MsgBox \"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c OUTLOOK \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u043e\u0447\u0442\u044b\", vbCritical: Exit Function       With OA.CreateItem(0)   '\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435         .To = Email$: .Subject = Subject$: .Body = MailText$         If VarType(AttachFilename) = vbString Then .Attachments.Add AttachFilename         If VarType(AttachFilename) = vbObject Then    ' AttachFilename as Collection             For Each File In AttachFilename: .Attachments.Add File: Next         End If         For i = 1 To 100000: DoEvents: Next    ' \u0431\u0435\u0437 \u043f\u0430\u0443\u0437\u044b \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0438\u0441\u044c\u043c\u0430 \u0431\u0435\u0437 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0439         Err.Clear: .send         SendEmailOutlook = Err = 0     End With     Set OutApp = Nothing End Function ________________________________________________________________________________ Sub sendMail()    '\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0438\u0441\u044c\u043c\u043e \u0441 1 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c     attach$ = \"\u0412\u0430\u0448_\u043f\u0443\u0442\u044c_\u0434\u043e_\u0444\u0430\u0439\u043b\u0430\\\u0444\u0430\u0439\u043b.xlsx\"    ' \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0444\u0430\u0439\u043b Excel     res = SendEmailOutlook(\"itkod2020@gmail.com\", \"\", \"Label_\u0434\u043b\u044f_Gmail\", attach$) End Sub<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 App Script  \u0432\u0430\u0448\u0435\u0439 Google \u0442\u0430\u0431\u043b\u0438\u0446\u044b  \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0435 \u0444\u0443\u043a\u0446\u0438\u0438.\u041f\u0435\u0440\u0432\u0430\u044f, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0441 &#171;\u0412\u0430\u0448\u0435\u0439 \u043c\u0435\u0442\u043a\u043e\u0439&#187;. \u0412\u0442\u043e\u0440\u0430\u044f, \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u043e\u0432\u043e\u0439 \u043a\u043d\u0438\u0433\u0438 \u0432 Google Drive \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u042d\u043a\u0441\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0432 \u0432\u0430\u0448 Google sheet \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u0443\u044e \u043a\u043d\u0438\u0433\u0443 \u0441 Google Drive.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"434\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/794\/6bf\/273\/7946bf2733fe930d69ad4835d27296b8.png\" data-width=\"1075\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"452\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fa7\/ef9\/d1b\/fa7ef9d1bf4c3cfebf0388e840314b84.png\" data-width=\"1142\"\/><figcaption><\/figcaption><\/figure>\n<pre><code>function emailTrigger() {   var label = GmailApp.getUserLabelByName(\"\u0412\u0430\u0448\u0430_\u041c\u0435\u0442\u043a\u0430 \u0432 Gmail\"); \/\/\u043c\u0435\u0442\u043a\u0430 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 \u0432 \u0433\u0443\u0433\u043b \u043f\u043e\u0447\u0442\u0430   if(label != null){     var threads = label.getThreads();     for (var i=0; i&lt;threads.length; i++) {       getExcelFile(threads[i]);       threads[i].removeLabel(label);     }   } }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0\u0434\u043b\u044f\u00a0\u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f\u00a0\u0444\u0430\u0439\u043b\u0430\u00a0Excel<\/p>\n<pre><code>function getExcelFile(thread)  { \/\/\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 Excel      var messages = thread.getMessages(); \/\/\u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435   var len = messages.length; \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435   var message = messages[len-1] \/\/\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435   var attachments = message.getAttachments(); \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f       \/\/\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430   var xlsxBlob = attachments[0]; \/\/ \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u044f[0] - \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0444\u0430\u0439\u043b\u0430 xlsx.   Logger.log(xlsxBlob.getContentType())   var convertedSpreadsheetId = Drive.Files.insert({mimeType: MimeType.GOOGLE_SHEETS}, xlsxBlob).id; \/\/\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 Excel \u0432 \"Google \u041b\u0438\u0441\u0442\" \u043d\u0430 Google \u0434\u0438\u0441\u043a\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430   var filename = xlsxBlob.getName(); \/\/\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432   var tabName = filename.substring(13).slice(0,filename.length-18); \/\/ \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0439\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0434\u0430\u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u043d\u0435\u043c \u0432\u043a\u043b\u0430\u0434\u043a\u0438    var sheet = SpreadsheetApp.openById(convertedSpreadsheetId).getSheets()[0]; \/\/ \u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 Excel -> \u0442\u0435\u043f\u0435\u0440\u044c google sheet var destination = SpreadsheetApp.openById(\"ID \u0432\u0430\u0448\u0435\u0433\u043e Google Sheets\"); \/\/id \u0433\u0443\u0433\u043b \u0444\u0430\u0439\u043b\u0430(\u0438\u0437 \u0441\u0441\u044b\u043b\u043a\u0438 ) var sss=destination.getSheetByName(\"\u0418\u043c\u044f \u043b\u0438\u0441\u0442\u0430 \u0432 Google Sheets\");\/\/\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0443\u0433\u043b \u043b\u0438\u0441\u0442\u0430 \u043a\u0443\u0434\u0430 \u043b\u0435\u0442\u044f\u0442 \u0434\u0430\u043d\u043d\u044b\u0435  \/\/\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441 Drive Google  Drive.Files.remove(convertedSpreadsheetId); labelName='\u0412\u0430\u0448\u0430_\u041c\u0435\u0442\u043a\u0430 \u0432 Gmail'; deleteForever(labelName); }  function deleteForever(labelName) {     var threads = GmailApp.search(\"in:trash label:\" + labelName);     for (var i = 0; i &lt; threads.length; i++) {       threads[i].moveToTrash();      } };<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043a\u0430\u043a \u0432\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u043e: \u0440\u0430\u0437 \u0432 \u043c\u0438\u043d\u0443\u0442\u044b, \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441 \u0438 \u0442.\u0434.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"754\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4c7\/83b\/ab3\/4c783bab3ef8c3ac0477c77dcc08dd1d.png\" data-width=\"1483\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432 Gmail \u043f\u0430\u043f\u043a\u0443 \u0441 \u043c\u0435\u0442\u043a\u043e\u0439(Label) \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 App Script \u0431\u0443\u0434\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0430 VBA &#171;Sub sendMail()&#187; \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0438\u0441\u0442\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u043c\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u042d\u043a\u0441\u0435\u043b\u044c \u0441 Google Sheets, \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0434\u043e\u0431\u0435\u043d \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u043d \u043a\u0430\u043a \u0432 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a \u0438 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e!<\/p>\n<div class=\"persona\" persona=\"true\"><img persona=\"true\" class=\"image persona__image\"\/><\/p>\n<h5 class=\"persona__heading\" persona=\"true\">\u0410\u043b\u0435\u043a\u0441\u0435\u0439 \u0421\u043e\u0431\u043e\u043b\u0435\u0432<\/h5>\n<p persona=\"true\" class=\"persona__text\">\u042d\u043d\u0442\u0443\u0437\u0438\u0430\u0441\u0442, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442-\u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/647665\/\"> https:\/\/habr.com\/ru\/post\/647665\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p>&#171;\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u2014 \u0437\u0430\u043b\u043e\u0433 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438.&#187;<\/p>\n<\/blockquote>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c MS Excel \u0438 Google Docs, \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0430 VBA, App Script \u0438 JavaScript.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0430<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 *.XLSX \u0432 Google Sheets \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 VBA \u0438 App Script \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445(\u0433\u0440\u0430\u043d\u0438\u0446\u044b, \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435).<\/p>\n<p>\u0426\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Google Sheets \u0438\u0437 XLSX  \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 VBA \u0438 App Script.<\/p>\n<p>\u0412\u0441\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 VBA, App Script \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.\u00a0  <\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f, \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0438\u043c\u0435\u0435\u043c:<\/h2>\n<ul>\n<li>\n<p><strong>Microsoft<\/strong>\u00a0<strong>Excel<\/strong>  <\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0447\u0442\u0430\u0432\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430 Outlook<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0447\u0442\u0430<\/strong>\u00a0<strong>Gmail<\/strong>  <\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c:<\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 XLSX \u0432 Google Sheets \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 VBA \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0447\u0442\u043e\u0432\u0443\u044e \u0441\u043b\u0443\u0436\u0431\u0443 Outlook \u043d\u0430 \u0441\u0432\u043e\u044e \u043f\u043e\u0447\u0442\u0443 Gmail \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u0442\u043a\u043e\u0439, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e App Script \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Google Sheets \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442.<\/p>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u0440\u043e\u0440\u0435 VBA \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430 \u0441 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c:<\/p>\n<pre><code>Function SendEmailOutlook(ByVal Email$, ByVal MailText$, Optional ByVal Subject$ = \"\", _                                Optional ByVal AttachFilename As Variant) As Boolean     On Error Resume Next: Err.Clear     Dim OA As Object: Set OA = CreateObject(\"Outlook.Application\")     If OA Is Nothing Then MsgBox \"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c OUTLOOK \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u043e\u0447\u0442\u044b\", vbCritical: Exit Function       With OA.CreateItem(0)   '\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435         .To = Email$: .Subject = Subject$: .Body = MailText$         If VarType(AttachFilename) = vbString Then .Attachments.Add AttachFilename         If VarType(AttachFilename) = vbObject Then    ' AttachFilename as Collection             For Each File In AttachFilename: .Attachments.Add File: Next         End If         For i = 1 To 100000: DoEvents: Next    ' \u0431\u0435\u0437 \u043f\u0430\u0443\u0437\u044b \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0438\u0441\u044c\u043c\u0430 \u0431\u0435\u0437 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0439         Err.Clear: .send         SendEmailOutlook = Err = 0     End With     Set OutApp = Nothing End Function ________________________________________________________________________________ Sub sendMail()    '\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0438\u0441\u044c\u043c\u043e \u0441 1 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c     attach$ = \"\u0412\u0430\u0448_\u043f\u0443\u0442\u044c_\u0434\u043e_\u0444\u0430\u0439\u043b\u0430\\\u0444\u0430\u0439\u043b.xlsx\"    ' \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0444\u0430\u0439\u043b Excel     res = SendEmailOutlook(\"itkod2020@gmail.com\", \"\", \"Label_\u0434\u043b\u044f_Gmail\", attach$) End Sub<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 App Script  \u0432\u0430\u0448\u0435\u0439 Google \u0442\u0430\u0431\u043b\u0438\u0446\u044b  \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0435 \u0444\u0443\u043a\u0446\u0438\u0438.\u041f\u0435\u0440\u0432\u0430\u044f, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0441 &#171;\u0412\u0430\u0448\u0435\u0439 \u043c\u0435\u0442\u043a\u043e\u0439&#187;. \u0412\u0442\u043e\u0440\u0430\u044f, \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u043e\u0432\u043e\u0439 \u043a\u043d\u0438\u0433\u0438 \u0432 Google Drive \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u042d\u043a\u0441\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0432 \u0432\u0430\u0448 Google sheet \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u0443\u044e \u043a\u043d\u0438\u0433\u0443 \u0441 Google Drive.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<figure class=\"float full-width\"><figcaption><\/figcaption><\/figure>\n<pre><code>function emailTrigger() {   var label = GmailApp.getUserLabelByName(\"\u0412\u0430\u0448\u0430_\u041c\u0435\u0442\u043a\u0430 \u0432 Gmail\"); \/\/\u043c\u0435\u0442\u043a\u0430 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 \u0432 \u0433\u0443\u0433\u043b \u043f\u043e\u0447\u0442\u0430   if(label != null){     var threads = label.getThreads();     for (var i=0; i&lt;threads.length; i++) {       getExcelFile(threads[i]);       threads[i].removeLabel(label);     }   } }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0\u0434\u043b\u044f\u00a0\u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f\u00a0\u0444\u0430\u0439\u043b\u0430\u00a0Excel<\/p>\n<pre><code>function getExcelFile(thread)  { \/\/\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 Excel      var messages = thread.getMessages(); \/\/\u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435   var len = messages.length; \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435   var message = messages[len-1] \/\/\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435   var attachments = message.getAttachments(); \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f       \/\/\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430   var xlsxBlob = attachments[0]; \/\/ \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u044f[0] - \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0444\u0430\u0439\u043b\u0430 xlsx.   Logger.log(xlsxBlob.getContentType())   var convertedSpreadsheetId = Drive.Files.insert({mimeType: MimeType.GOOGLE_SHEETS}, xlsxBlob).id; \/\/\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 Excel \u0432 \"Google \u041b\u0438\u0441\u0442\" \u043d\u0430 Google \u0434\u0438\u0441\u043a\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430   var filename = xlsxBlob.getName(); \/\/\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432   var tabName = filename.substring(13).slice(0,filename.length-18); \/\/ \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0439\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0434\u0430\u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u043d\u0435\u043c \u0432\u043a\u043b\u0430\u0434\u043a\u0438    var sheet = SpreadsheetApp.openById(convertedSpreadsheetId).getSheets()[0]; \/\/ \u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 Excel -> \u0442\u0435\u043f\u0435\u0440\u044c google sheet var destination = SpreadsheetApp.openById(\"ID \u0432\u0430\u0448\u0435\u0433\u043e Google Sheets\"); \/\/id \u0433\u0443\u0433\u043b \u0444\u0430\u0439\u043b\u0430(\u0438\u0437 \u0441\u0441\u044b\u043b\u043a\u0438 ) var sss=destination.getSheetByName(\"\u0418\u043c\u044f \u043b\u0438\u0441\u0442\u0430 \u0432 Google Sheets\");\/\/\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0443\u0433\u043b \u043b\u0438\u0441\u0442\u0430 \u043a\u0443\u0434\u0430 \u043b\u0435\u0442\u044f\u0442 \u0434\u0430\u043d\u043d\u044b\u0435  \/\/\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441 Drive Google  Drive.Files.remove(convertedSpreadsheetId); labelName='\u0412\u0430\u0448\u0430_\u041c\u0435\u0442\u043a\u0430 \u0432 Gmail'; deleteForever(labelName); }  function deleteForever(labelName) {     var threads = GmailApp.search(\"in:trash label:\" + labelName);     for (var i = 0; i &lt; threads.length; i++) {       threads[i].moveToTrash();      } };<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043a\u0430\u043a \u0432\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u043e: \u0440\u0430\u0437 \u0432 \u043c\u0438\u043d\u0443\u0442\u044b, \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441 \u0438 \u0442.\u0434.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432 Gmail \u043f\u0430\u043f\u043a\u0443 \u0441 \u043c\u0435\u0442\u043a\u043e\u0439(Label) \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 App Script \u0431\u0443\u0434\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0430 VBA &#171;Sub sendMail()&#187; \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0438\u0441\u0442\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u043c\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u042d\u043a\u0441\u0435\u043b\u044c \u0441 Google Sheets, \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0434\u043e\u0431\u0435\u043d \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u043d \u043a\u0430\u043a \u0432 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a \u0438 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e!<\/p>\n<div class=\"persona\" persona=\"true\">\n<h5 class=\"persona__heading\" persona=\"true\">\u0410\u043b\u0435\u043a\u0441\u0435\u0439 \u0421\u043e\u0431\u043e\u043b\u0435\u0432<\/h5>\n<p persona=\"true\" class=\"persona__text\">\u042d\u043d\u0442\u0443\u0437\u0438\u0430\u0441\u0442, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442-\u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/647665\/\"> https:\/\/habr.com\/ru\/post\/647665\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-328575","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=328575"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328575\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}