<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум компьютерной помощи &mdash; Сохранение и отображение картинки в поле]]></title>
	<link rel="self" href="https://itpmr.ru/extern.php?action=feed&amp;tid=818&amp;type=atom" />
	<updated>2014-04-09T06:53:00Z</updated>
	<generator>PunBB</generator>
	<id>https://itpmr.ru/viewtopic.php?id=818</id>
		<entry>
			<title type="html"><![CDATA[Re: Сохранение и отображение картинки в поле]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124143#p124143" />
			<content type="html"><![CDATA[<p>То же самое, только меньше текста:</p><p>Sub Click(Source As Button)<br />&nbsp; &nbsp; Dim s As New NotesSession<br />&nbsp; &nbsp; Dim db As NotesDatabase<br />&nbsp; &nbsp; Dim doc As NotesDocument<br />&nbsp; &nbsp; Dim body As NotesMIMEEntity<br />&nbsp; &nbsp; Dim stream As NotesStream<br />&nbsp; &nbsp; Set db = s.CurrentDatabase<br />&nbsp; &nbsp; s.ConvertMIME = False &#039; Do not convert MIME to rich text<br />&nbsp; &nbsp; Set doc = db.CreateDocument<br />&nbsp; &nbsp; Call doc.ReplaceItemValue(&quot;Form&quot;, &quot;fmejved&quot;)<br />&nbsp; &nbsp; Set body = doc.CreateMIMEEntity<br />&nbsp; &nbsp; Set stream = s.CreateStream<br />&nbsp; &nbsp; Call stream.Open(&quot;C:\text\111110.gif&quot;, &quot;binary&quot;) <br />&nbsp; &nbsp; Call body.SetContentFromBytes(stream, &quot;image/gif&quot;, ENC_IDENTITY_BINARY)<br />&nbsp; &nbsp; Call stream.Close<br />&nbsp; &nbsp; Call doc.Save(True, True)<br />ExitSub:<br />&nbsp; &nbsp; s.ConvertMIME = True &#039; Restore conversion<br />End Sub</p>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2014-04-09T06:53:00Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124143#p124143</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Сохранение и отображение картинки в поле]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124035#p124035" />
			<content type="html"><![CDATA[<p>Этот скрипт создает документ, загружает картинку 111110.gif в поле body на форме fmejved.<br />Картинка отображается не как вложение!</p><p>Sub Click(Source As Button)<br />&nbsp; &nbsp; Dim s As New NotesSession<br />&nbsp; &nbsp; Dim db As NotesDatabase<br />&nbsp; &nbsp; Dim doc As NotesDocument<br />&nbsp; &nbsp; Dim body As NotesMIMEEntity<br />&nbsp; &nbsp; Dim stream As NotesStream<br />&nbsp; &nbsp; Set db = s.CurrentDatabase<br />&nbsp; &nbsp; s.ConvertMIME = False &#039; Do not convert MIME to rich text<br />&nbsp; &nbsp; Set doc = db.CreateDocument<br />&nbsp; &nbsp; Call doc.ReplaceItemValue(&quot;Form&quot;, &quot;fmejved&quot;)<br />&nbsp; &nbsp; Set body = doc.CreateMIMEEntity<br />&nbsp; &nbsp; Set header = body.CreateHeader(&quot;Subject&quot;)<br />&nbsp; &nbsp; Call header.SetHeaderVal(&quot;MIME image from GIF file&quot;)<br />&nbsp; &nbsp; Set stream = s.CreateStream<br />&nbsp; &nbsp; If Not stream.Open(&quot;C:\text\111110.gif&quot;, &quot;binary&quot;) Then<br />&nbsp; &nbsp; &nbsp; &nbsp; Messagebox &quot;C:\text\111110.gif&quot;,&quot;Open failed&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; Goto ExitSub<br />&nbsp; &nbsp; End If<br />&nbsp; &nbsp; If stream.Bytes = 0 Then<br />&nbsp; &nbsp; &nbsp; &nbsp; Messagebox &quot;C:\text\111110.gif&quot;,, &quot;File has no content&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; Goto ExitSub<br />&nbsp; &nbsp; End If<br />&nbsp; &nbsp; Call body.SetContentFromBytes(stream, &quot;image/gif&quot;, ENC_IDENTITY_BINARY)<br />&nbsp; &nbsp; Call stream.Close<br />&nbsp; &nbsp; Call doc.Save(True, True)<br />ExitSub:<br />&nbsp; &nbsp; s.ConvertMIME = True &#039; Restore conversion<br />End Sub</p>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2013-11-26T12:11:16Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124035#p124035</id>
		</entry>
</feed>
