Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim reply As NotesDocument
Dim body As NotesMimeEntity
Dim stream As NotesStream
Dim s1 As String
Dim s2 As String
session.ConvertMime = False ' We do want Notes to convert MIME to Rich Text
Set session = New NotesSession
Set db = session.CurrentDatabase
Set docs = db.UnprocessedDocuments
Count = docs.Count
If docs.Count > 0 Then
For n = 1 To docs.Count
Set memo = docs.GetNthDocument(n)
If Not( memo.SentByAgent ) Then
Set reply = memo.CreateReplyMessage( False )
reply.Subject = "Re: e-mail bot " & memo.Subject( 0 )
Call reply.RemoveItem( "Body" )
Set body = reply.CreateMIMEEntity("Body")
Set stream = session.CreateStream
s1 =Chr$(123)
s2 =Chr$(125)
Call stream.WriteText({<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">})
Call stream.WriteText({<html xmlns="http://www.w3.org/1999/xhtml">})
Call stream.WriteText({<head>})
Call stream.WriteText({<title>Отчет запроса - Управление архитектуры и градостроительства.</title>})
Call stream.WriteText({<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />})
Call stream.WriteText({</head>})
'css
Call stream.WriteText({<style type="text/css">})
Call stream.WriteText({*}&Chr$(123)&{margin: 0;padding: 0;}&Chr$(125))
Call stream.WriteText({body}&Chr$(123)&{background: #e0f3fa;font-family: Arial, Helvetica, sans-serif;font-size: 12px;line-height: 17px;color: #222;}&Chr$(125))
Call stream.WriteText({#wrap}&Chr$(123)&{margin: 20px auto;width: 700px;}&Chr$(125))
Call stream.WriteText({#header}&Chr$(123)&{height: 70px;background: #99FF33;}&Chr$(125))
Call stream.WriteText({</style>})
Call stream.WriteText({<body>})
Call stream.WriteText({<div id="wrap">})
Call stream.WriteText({<div id="header">})
Call stream.WriteText({<h1>Сервис - Контроль исполнения заявки</h1>})
Call stream.WriteText({<h2>Управление архитектуры и градостроительства мэрии г. Череповца</h2>})
Call stream.WriteText({</div>})
Call stream.WriteText({<div id="content">})
Call stream.WriteText({<div class="right"> })
Call stream.WriteText({<h2><a href="#">Общие данные запроса</a></h2>})
Call stream.WriteText({<div class="articles">})
Call stream.WriteText({<ul>Заявитель:</ul>})
Call stream.WriteText({<ul>Номер заявки:</ul>})
Call stream.WriteText({<ul>Дата заявки:</ul>})
Call stream.WriteText({<ul>Содержание заявки:</ul>})
Call stream.WriteText({</div>})
Call stream.WriteText({<h2><a href="#">Ход исполнения заявки</a></h2>})
Call stream.WriteText({<div class="articles">})
Call stream.WriteText({<ul>Статус документа:</ul>})
Call stream.WriteText({<ul>Дата окончания срока:</ul>})
Call stream.WriteText({<ul>ФИО начальника отдела:</ul>})
Call stream.WriteText({<ul>Контактная информация:</ul>})
Call stream.WriteText({</div>})
Call stream.WriteText({</div>})
Call stream.WriteText({</div>})
Call stream.WriteText({<div id="footer">})
Call stream.WriteText({<a href="http://www.cherinfo.ru/">Lomaet text Управление архитектуры и градостроительства мэрии г. Череповца</a>})
Call stream.WriteText({</div>})
Call stream.WriteText({</div>})
Call stream.WriteText({</body>})
Call stream.WriteText({</html>})
Call body.SetContentFromText _
(stream, "text/html;", ENC_NONE)
Call stream.Truncate
Call reply.Send( False )
End If
Call session.UpdateProcessedDoc(memo)
Next
End If
session.ConvertMime = True ' Reset the value
End Sub