I have a requirement to copy stationery into a mail message, email this message and then, via a button, automatically copy the stationary attachments into the person's stationery folder. I can find code related to some aspects of what I am trying to do but they are all related to documents. Can you help please?
The stationery is a document. The code samples you have will probably work just fine.

If I understand your question correctly: you have stationery in your mail file, and you'd like to somehow turn it into a file. Then you want to mail the file to someone as an attachment in an e-mail message. The e-mail message also contains a button that they would click to install the stationery into their own mail file. Is that correct?

You can do this -- there are a couple of ways. The easiest way to take a Notes document and package it for shipment is via the NotesDXLExporter. Convert the document to DXL and store that in a file. Then, in your button code, extract the file attachment to a file in the user's temp directory and use the NotesDXLImporter to create a new Notes document out of it. Since the stationery document contains a username in some fields, you will also want to modify the document and change your name to the name of the user who pressed the button. Since the stationery folder is really a view, you don't have to do anything special to get the new stationery to appear in that view -- if it has the right field values it will be there automatically.

Choice 2, if you prefer not to use a file, is to place the DXL into a hidden non-summary field in the memo. This information would not be visible to the user, but a button in the body field of the memo could read the text from it and process it using the NotesDXLImporter.

Another way is to just write button code to automatically create the document you want by coding values for all the fields. This tool will take a stationery document in your mail file and automatically generate the code you would need to duplicate it. However, it doesn't write the code for rich text, and not all rich text is possible to produce via LotusScript. So, you'd have to code that part yourself if it was possible at all.

Another possibility, if you can assume the users all have access to your network, is to store the stationery document in a database to which everyone has reader access. Then, you can write your button code to fetch it from that database and copy all the fields to a new document you create in the user's mail file, again modifying certain fields to contain the user's name instead of yours.

Do you have comments on this Ask the Expert question and response? Let us know.

This was first published in March 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: