What is it about the dialogbox method

ok – 3rd post. PLEASE tell me someone has some insight into this.

When I create a document using with a dialog box, I cannot create file attachments within a specific rich text field via a button.

It puts it in there but on save puts it on the bottom of the doc – this does not happen if I create the form directly without the dialog box.

Subject: What is it about the dialogbox method…

It is not terribly well explained, but if you look at the bottom of the DialogBox method entry in the Help db, it says:

Field sharing is not supported for rich text fields.

and what it means is, you can set rich text values in a dialog box and have it work well. Annoying, but true.

Subject: RE: What is it about the dialogbox method…

nice. Thanks for pointing that out.

Do you have any suggestions for handling that? I guess I can loop through the attachments when I save? embed them then?

Or can I hide them on the bottom of the document in the notes client? That’s probably the simplest solution

Subject: RE: What is it about the dialogbox method…

I had a similar problem several years ago in R5. The only thing I could come up with was pretty kludgy. I knew the name of the attachment, so I used a script to put it in the desired rich-text field. Unfortunately, the grey, generic icon remained at the bottom of the form. As I recall, both icons could be launched, but of course it was confusing to the user. What I ended up doing (the kludge) was putting about half a page of blank lines (hard returns) at the bottom of my form. This way, the generic icon wouldn’t be visible unless the user scrolled way down. Granted the scrollbar was visible, but this was the best I could do at the time. There may be other ideas out there, but if Ben didn’t suggest anything better, I’m afraid you may be out of luck. Sorry.

Subject: RE: What is it about the dialogbox method…

so it will look as though it’s working but when I save that newdoc it won’t keep it?

I’m not ‘exchanging fields’ so to speak – i’m creating a new doc. Doesn’t matter does it?

ok – what can you tell me about the $v2atachmentoptions field? Only for the web?

Subject: RE: What is it about the dialogbox method…

If you’re just wanting to create a new document and use a dialogbox instead of a regular form (why!?), then you could always call NotesUIDocument.Save from within the dialog, e.g. in the Queryclose event if not Source.DialogBoxCanceled. The rich text would still not be available to any code that opened the dialogbox, but they could Delete the NotesDocument and reopen it from disk if this were necessary.

Subject: RE: What is it about the dialogbox method…

Thank you so much! That worked. (I love this forum – thanks everyone)

PS – does the $v2attachmentoptions field work in the Notes Client or is it web only?

I’m creating a contact db that must be displayed in a very small window – so aesthetically I need to use the dialog box to compose otherwise I would not make my life so difficult.

Sub Queryclose(Source As Notesuidocument, Continue As Variant)

If Source.DialogBoxCanceled Then

	If Messagebox ("Do you really want to Cancel?", _

	MB_YESNO+MB_ICONQUESTION, "Cancel") = IDNO Then

		Continue = False

	End If

End If

If Not Source.DialogBoxCanceled And Source.EditMode=True Then Call Source.Save

End Sub