G
Guest
Вопрос следующий можно ли используя язык формул определить, вложен ли файл в конкретное rtf поле документа ?
Познакомьтесь с пентестом веб-приложений на практике в нашем новом бесплатном курсе
Dim doc As NotesDocument
Dim rtitem As Variant
Dim fileCount As Integer
Const MAX = 100000
fileCount = 0
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) _
And ( o.FileSize > MAX ) Then
fileCount = fileCount + 1
Call o.ExtractFile _
( "c:\reports\newfile" & Cstr(fileCount) )
Call o.Remove
Call doc.Save( True, True )
End If
End Forall
End If
Dim ws As New NotesUIWorkspace
Dim ws As NotesUIWorkspace
...
Set ws = New NotesUIWorkspace
Кроме того, ты ws не инициализировал.
Либо сразу инициализируй:
либо потом
Sub Postsave(Source As Notesuidocument)
Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Set doc = source.Document
Set rtitem= doc.GetFirstItem("PPasport")
Forall things In rtitem.EmbeddedObjects
If things.type = EMBED_ATTACHMENT Then
doc.SPOrders="2"
Elseif things.type = EMBED_OBJECT Then
doc.SPOrders="2"
Else
doc.SPOrders="3"
End If
Call doc.Save(True,True)
End Forall
End Sub
Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim rtitem As NotesRichTextItem
Call Source.Refresh(True)
Set rtitem = Source.Document.GetFirstItem("Body")
If Isempty(rtitem.EmbeddedObjects) Then 'нет объектов
End Sub
между Set doc = uidoc.Document и Set rtitem= doc.GetFirstItem("PPasport") поставте для счастья строчку call uidoc.refresh(TRUE) и должно быть счастье.написал такое
Dim ws As NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim rtitem As Variant
Dim things As Variant
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
Set rtitem= doc.GetFirstItem("PPasport")
Forall things In rtitem.EmbeddedObjects
' If things.type = EMBED_ATTACHMENT Then
' doc.SPOrders(0)="2"
' Elseif things.type = EMBED_OBJECT Then
' doc.SPOrders(0)="2"
' Else
' doc.SPOrders(0)="3"
' End If
' Call doc.Save(True,True)
'Messagebox message
End Forall
На строчку Forall ругается Object variable not set
Обучение наступательной кибербезопасности в игровой форме. Начать игру!