• 🔥 Бесплатный курс от Академии Кодебай: «Анализ защищенности веб-приложений»

    🛡 Научитесь находить и использовать уязвимости веб-приложений.
    🧠 Изучите SQLi, XSS, CSRF, IDOR и другие типовые атаки на практике.
    🧪 Погрузитесь в реальные лаборатории и взломайте свой первый сайт!
    🚀 Подходит новичкам — никаких сложных предварительных знаний не требуется.

    Доступ открыт прямо сейчас Записаться бесплатно

Set Body = Doc.getfirstitem("attach")

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

oxystile

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

Взломай свой первый сервер и прокачай скилл — Начни игру на HackerLab