I have an email with a button attached to detach an attachment to their notes directory.
Dim session As New NotesSession
Dim server As String
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim dbug As NotesLog
Dim rtitem As Variant
Dim fileCount As Integer
Dim it As NotesItem
server = session.GetEnvironmentString("Directory", True)
REM Specify the size limit for attachments
Const MaxSize = 5
fileCount = 0
If ( rtitem.Type = RICHTEXt ) Then
Forall o In rtitem.EmbeddedObjects
REM Note how many files we have processed
fileCount = fileCount + 1
dbug.LogAction(“file count:”+Cstr(fileCount))
If ( o.Type = EMBED_ATTACHMENT ) Then
Call o.ExtractFile( “c:\tmp\newfile” & Cstr( fileCount ) )
Call o.Remove
REM Note that we removed an attachment
dbug.LogAction(“attachment removed”)
REM Created a field noting that we removed an attachment
doc.stripped = “yes”
Call doc.Save( True, True )
End If
End Forall
End If
When I click the button I get an error of:
Variant does not contain an object
I’ve checked the Notes Help, which provided the same code as what I wrote. But it’s not working. Any suggestions?
Thanks
Edmound