ОБСУЖДЕНИЕ

Set Body = Doc.getfirstitem("attach")

7 ответов 5,9 тыс.
AI-выжимка обсуждения скоро
Статус
Закрыто для дальнейших ответов.
Код:
Dim body As NotesRichTextItem
Set body = doc.GetFirstItem("Attach")

есть поле Attach в документе, но через раз body="", почему и как исправить?
 
Для: oxystile
а почему не так как в хэлпе

Код:
Dim body As NotesRichTextItem
Set body = New NotesRichTextItem ( doc, "Attach" )

да ,и документ сохранён?
 
да, документ сохранен.
вроде как нашла причину, пока проверяю:

The compiler raises an error if you try to set the return value of GetFirstItem equal to a NotesRichTextItem object. This is because a NotesItem is not necessarily a NotesRichTextItem, and the compiler has no way of knowing whether the name$ you specify actually corresponds to a rich text item. For example:
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
'compiler complains
The solution to this problem is to declare a variant, set it equal to the return value of GetFirstItem, and then treat the variant as a NotesRichTextItem. For example:
Dim doc As NotesDocument
Dim rtitem As Variant
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
'...use NotesRichTextItem methods...
End If
 
<!--QuoteBegin-oxystile+18:10:2007, 10:02 -->
<span class="vbquote">(oxystile @ 18:10:2007, 10:02 )</span><!--QuoteEBegin-->[snapback]82213" rel="nofollow" target="_blank[/snapback]</div>[/quote]
Ух красавица програмист - администратор ;)
 
Для: oxystile
Я тоже :(. (а какой приз?)
 
Статус
Закрыто для дальнейших ответов.

Статистика тем

Создано
oxystile,
Последний ответ от
Hedg,
Ответы
7
Просмотры
5 886