Invisible attachments in R8.5

We have a serious problem in mixed R8.0.x and R8.5.x environment.

We send Notices with attached files from a back-end process. In R8.0 (and earlier) we are able to see the attachment icon in the inbox, and when opening the notice, we see the attachment in the body of the text. In R8.5 (both full and thin) we see the icon in the view, but the attachment is not visible when we open the document. I know the attachment is there, because it’s got a $File entry. I also know it’s there, because if I open the same database with an R8.0 client, I see it!

Is there anyone who can help me fix this - I have a major project due for release now stuck until it is fixed.

Thanks.

Subject: Exact same problem here

We are running into the same problem as described by the OP.

Only emails from a back end process are affected.

No solution so far. Still inevstigating.

Subject: if you are willing to discuss this…

we can have a web conference - email me on watkanaidoo@lycos.com

Subject: haven’t heard of this one

and I suggest you pursue it thru Lotus Support as it sounds like a regression.

However, if you show some code, there may be something someone can suggest to encode your attachments differently so that they will show in both versions.

Subject: some code

It is very straightforward…'reading from note, creating docNotice, populate fields, then send

Dim body As NotesRichTextItem

Dim bodyOriginal as Variant

Set bodyOriginal=note.getFirstItem(“DspBody”) 'DspBody is a richtext field in the open UI document, containing text and attachments

Set docNotice=dbCurrent.createDocument

docNotice.form=“Notice”

…populate some fields like SendTo, Subject,StartDateTime, EndDateTime etc

Set body = New NotesRichTextItem( docNotice, “Body” )

Call body.AddNewline(1)

Call body.AppendRTItem(bodyOriginal)

Call body.AddNewline(1)

Call docNotice.Send(False)

Like I said, in every case EXCEPT R8.5 (including other clients like Outlook, Google) the attachment is visible.

If you can assist, I will be very glad - waiting for Product Support will kill this project (and maybe me).

Subject: please send me a database containing one of the problem documents.

A small database – not the entire mail file design. andre underscore guirard, us.ibm

Subject: Done

simply copy the single document and paste it into your Mail database.

Subject: Are you using the same userID on both systems?

The paragraph containing the attachment has the following hide formula:

iwFlag!=“1” | ( iwFlag = “1” & (@Name([CN];@UserName) != @Name([CN];from) | @Name([CN];@UserName) != @Name([CN];Chair)))

When I change the values of the items in the document so that this formula returns False, I have no problem seeing the attachment in version 8.5.2.

Subject: where do you see the Hide-when formula?

It’s not in the design - this is an “out-of-the-box” Notice.

You are right - this is visible / hidden depending on who is looking. But it’s only relevant to the attachment - rich-text content of the same field is visible regardless.

Does the hide-when formula travel with the attachment on the Notice? If so, how can I get rid of it when sending?

Subject: about hide formulas on a rich-text field

DO NOT use hide formulas on a paragraph containing a rich text field on a form. Rich text paragraphs have their own hide formulas embedded in the rich text, along with the other paragraph settings like indentation, etc. So the problem is on the Notice form, and you should change that design to hide this rich text in a different way. SeeRich Text field hiding Technote.

There’s no easy way to get rid of the hide formula once it’s stored in the rich text data. You could do it with the C API, or by DXL-export, manipulate the DXL and re-import.

Subject: I see … but

why is only the attachment hidden? The rich-text content of the same field is visible both to me (author) and others. And I still need a solution, because Computed Subforms won’t work for me.

For my own info - how did you see the actual hide-when formula? It in fact belongs to the rich-text field in the original source (Appointment) form, not part of the design of the Notice that I sent you. Is there some Notes toolkit that allows for this and can a humble mortal like me get one?

Thanks for your help.

Subject: The NotesPeek tool is available for download somewhere or other…

that’s what I used.

I think only the attachment was hidden, because it is the first paragraph and took on the default attributes of the field when the Notice document was saved. You haven’t said enough about your application for me to be able to tell why a computed subform or section editors formula wouldn’t work for you.

Subject: You are right (as always)

The hide-when seems to be inherited by the first paragraph only. So if I can find a way to insert a blank line at the start of this field, then attachments and text are both visible to all.

FYI - for me subforms have the very negative attribute of needing to be loaded along with the form upon instantiation. If some condition changes (which is what is happening in my application if the meeting creator is selecing my application’s functionality from inside an open Appointment form), then the subform is not there. If you know of a way to make it work, then please tell me.

I am using NotesPeek all the time, but didn’t see a Hide-when attribute for the attachment (it’s for the paragraph, which I wasn’t looking at).

Subject: You can close and reopen the document without saving…

as described in Update rich text tip. That will refresh the subform formulas.

Inserting a new first paragraph now will not do you any good. The paragraph containing the file attachment is already ruined by the hide formula that was on the form at the time the document was created. Inserting another paragraph before it, doesn’t change the fact that the paragraph you want has a hide formula.

It’s not the fact that it’s the first paragraph that makes it take on the hide formula from the form. It’s that it was the first paragraph when the document was created (and in addition, there’s probably a space before the rich text field on the form, so that there’s already a paragraph started that your first paragraph becomes a continuation of). When you’re reading the document in the back end, the form design is irrelevant.

As well as changing the form design, you’ll have to fix the existing data to remove hide formulas.

Or, you could detach the file to local disk and attach it to the new document. Front-end file attachments in LotusScript.

Subject: well, I am already doing it once

and there’s the problem that it leaves the original UIDoc visible until I save and close it. Setting SaveOptions to “0” does not allow the uidoc to be closed.

this is the block of code where the “faulty” paragraph is being copied.

note.SaveOptions = “0”

Set uidocNew = ws.EditDocument(True, note, , , , True)

Call uidocNew.Document.RemoveItem(“Body”)

Call uidocNew.Document.CreateRichTextItem(“Body”)

Call rtitem.CopyItemToDocument(uidocNew.Document,“Body”)

Call uidocNew.Reload

closeUI:

Call uidoc.FieldSetText(“SaveOptions”,“0”)

On Error Resume Next ’ trap known errors

Call uidoc.FieldSetText(“mywFlag”,“”)

Call uidoc.FieldSetText(“CalendarDateTime”,“”)

On Error Goto ProcessError1

docID = uidoc.Document.UniversalID

Call uidoc.Save

Call uidoc.Close(True)

Set uidoc = Nothing

If you can help me get the original UI to close without saving, then maybe I can get another “ws.EditDocument” to correctly load the subform.

Subject: Suggest you do not discard errors

The statement On Error Resume Next may be discarding an error message that would let you know what’s going wrong.It’s not clear to me exactly how this is failing.

If the document is failing to close, that suggests to me that you should look for queryclose code.

If the user is prompted whether to save, or is saving automatically on close, this might be due to some queryclose code.

In any case, carefully review all event code and insert debugging output so that you can tell what it’s doing.

I’ve far exceeded my usual limit of 2 responses on this thread, so I’m going to have to bow out now. What I’ve told you can be made to work, so you’re just going to have to figure out what the problem is. Good luck.