• Курсы Академии Кодебай, стартующие в мае - июне, от команды The Codeby

    1. Цифровая криминалистика и реагирование на инциденты
    2. ОС Linux (DFIR) Старт: 16 мая
    3. Анализ фишинговых атак Старт: 16 мая Устройства для тестирования на проникновение Старт: 16 мая

    Скидки до 10%

    Полный список ближайших курсов ...

Set Body = Doc.getfirstitem("attach")

  • Автор темы oxystile
  • Дата начала
Статус
Закрыто для дальнейших ответов.
O

oxystile

Код:
Dim body As NotesRichTextItem
Set body = doc.GetFirstItem("Attach")

есть поле Attach в документе, но через раз body="", почему и как исправить?
 
M

morpheus

Для: oxystile
а почему не так как в хэлпе

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

да ,и документ сохранён?
 
O

oxystile

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

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
 
M

morpheus

<!--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]
Ух красавица програмист - администратор ;)
 
Статус
Закрыто для дальнейших ответов.
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!