logo

New Response

« Return to the main article

You are replying to:

  1. Hello Jake,

    I have read your article about the control of attachments and I was impressed. I also hate the style how domino displays attachments and I've looked for an alternative and found it on your side. Thank you very much. I've integrated your mechanism in an application and it works like a charm.

    Now I have a question. I want to display different symbols before the link of the attachment. For example: If the document has an attachment with the extension '.txt' I want to display the viewicon 'vwicn020.gif'. If the document has an attachment with the extension '.doc' I want to display the Wordicon 'vwicn142.gif'.

    At the moment I have the following code for the computed text field:

    ************************************* tmpASum:=@Text(@Round((@Sum(@AttachmentLengths)/1024);0,01)) + " Kbytes"; tmpALen:=@Text(@Round((@AttachmentLengths/1024);0,01)) + " Kbytes"; tmprepl:= ".html":".htm":".txt":".zip":".exe":".gif":".jpg":".bmp":".doc":".xls":".wav":". mid":".midi"; tmprwith := "vwicn070.gif":"vwicn070.gif":"vwicn020.gif":"vwicn051.gif":"vwicn159.gif":"vwic n013.gif":"vwicn013.gif":"vwicn013.gif":"vwicn142.gif":"vwicn141.gif":"vwicn015. gif":"vwicn015.gif":"vwicn015.gif"; @If(!@Attachments;@Return("");""); @If(@IsDocBeingEdited; "<br><br><table border=1 bgcolor=\"#0000aa\" cellspacing=0 cellpadding=5><tr><td>"+ "<font size=2 face=\"arial\" color=\"#ffffff\">"+ "Attachments l&ouml;schen:"+ "</font><font size=1 color=\"#555555\">"+ @Implode("<table border=0 bgcolor=\"#eaeff0\" width=300 cellpadding=5>"+ "<tr><td><input type=\"checkbox\" name=\"%%Detach\" value=\""+@AttachmentNames+"\">"+ "<font size=2 face=\"verdana\">"+@AttachmentNames+ "<br></td></tr></table>")+ "</td></tr></table>"; "<br><br><table border=1 bgcolor=\"#0000aa\" cellspacing=0 cellpadding=5><tr><td>"+ "<font size=2 face=\"arial\" color=\"#ffffff\">"+ "Attachments ansehen ("+tmpASum+") :"+ "</font><font size=1 color=\"#555555\">"+ @Implode("<table border=0 bgcolor=\"#eaeff0\" width=300 cellpadding=5>"+ "<tr><td width=200>"+ @If(@Contains("." + @Right(@AttachmentNames;"."); @Implode(tmprepl));""; @Replace("." + @Right(@AttachmentNames;"."); tmprepl; "<img src=\"/icons/" + tmprwith + " \"border=0 width=16 height=11 hspace=3>")) + "<a href=\"" + @Text(@DocumentUniqueID) + "/$file/" + @AttachmentNames+"\">"+ "<font size=2 face=\"arial\"><b>[ "+@AttachmentNames+" ]</b></font></a></td>"+ "<td width=10></td>"+ "<td width=150 align=right><font size=1 face=\"verdana\">"+tmpALen+"</font></td><tr></table>")+ "</td></tr></table>") ************************************* This works so far. But I try to find a solution for unrecognised attachments.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: