Hi, I don’t get to work, hiding attachments in my notes form.I have added a hidden, computed for display field to my form,called $V2AttachmentOptions,Value “0” and
I create a RT field(“Anexo”), throught an action, and there isn’t another rich text field on the form.
When I add an attachment,and save my document, this display the document with duplicate entries for the attachments.
i.e: If I add 2 attachments,this display in my doc, in this way:
$File: binary.gift
$File:exercise.text
Anexo:binary.gift
Anexo:exercise.text
And attachments still appears in edit and read mode, at the bottom. I have tried also, to get into a hidden section my RTfield…
My action code is:
Set odbactual = osesion.CurrentDatabase
Set ouidoc = owork.CurrentDocument
Set odocActual = ouidoc.Document
If ouidoc.IsNewDoc Then
If odocActual.titulo(0) <> “” Then
Call ouidoc.save
Else
Messagebox “Error”,16,“Aviso”
Exit Sub
End If
End If
Dim odocNewS As New NotesDocument( odbActual )
Dato = owork.DialogBox( “Select attachment”, True,True, False, False, False,False, “please select one.”, odocNewS, True)
If Dato = False Then Exit Sub
filename = odocNewS.Fichero (0)
var = odocNewS.Titulo (0)
nombreFichero$ = Strrightback(filename,"")
If Not odocActual.HasItem( “Id_Anexo” ) Then
odocActual.Id_Anexo= “”
odocActual.tamaño_Anexo = “”
odocActual.titulo_Anexo = “”
End If
Set oitemId = odocActual.GetFirstItem(“Id_Anexo” )
If Not (oitemId.Contains(nombreFichero$)) Then
If odocActual.HasItem( “Anexo” ) Then
Set ver = odocActual.GetFirstItem( “Anexo” )
If ( ver.Type = RICHTEXT ) Then
Set ortitem = odocActual.GetFirstItem( “Anexo” )
Else
Set ortitem = New NotesRichTextItem( odocActual, “Anexo” )
End If
Else
Set ortitem = New NotesRichTextItem( odocActual, “Anexo” )
End If
Set oEmbedded = ortitem.EmbedObject ( EMBED_ATTACHMENT, “”, filename )
sizeInBytes = oEmbedded.FileSize
If sizeInBytes>1024 Then
tamaño = Cstr(Round((sizeInBytes/1024),0))+" KB"
Else
tamaño = Cstr(sizeInBytes)+" BYTES"
End If
If var=“” Then
var = nombreFichero$
End If
Call oitemId.AppendToTextList(nombreFichero$)
Set oitemTamaño = odocActual.GetFirstItem( “tamaño_Anexo” )
Call oitemTamaño.AppendToTextList( tamaño )
Set oitemTituloAnexos = odocActual.GetFirstItem(“titulo_Anexo”)
Call oitemTituloAnexos.AppendToTextList(var)
Call ouidoc.refresh
Else
Messagebox “there’s other attachments with the same name”,16,“Aviso”
End If
I have this form, but in html, to display it in web,with the field $V2AttachmentOptions,Value “0”, and the action to attach is similar,and hiding attachments works great, in web!!!
I don’t find which is the problem in notes client.Can you offer any suggestions. I am desperate!