Create new memo using draft

Anybody want to write a button to add to the mail template which would create a new memo using previously created Draft stationery with a specific name?  Like "new memo" or "reply with history" but instead of referring to the Memo form, looking up the draft called "Custom Letterhead" in the Drafts folder.

I think it should be possible, I just don't have the time to look into it.  50 points for anyone who does!

...Pentapod
LVL 1
pentapodAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Z_BeeblebroxCommented:
I'm not entirely sure I understand what you need. Is the "Custom Letterhead" a form or just a document. If it is a form, just use @Command([Compose];"Custom Letterhead"). If it is a document, much more complicated programming will be required since I imagine that each time the user edits this document, you will want to save it as a new document. Hopefully this is not the case.
0
pentapodAuthor Commented:
"Custom Letterhead" is not a form, it is Personal Stationery as created using the "Actions"->"Mail Tools"->"Create Stationery" option.  

Creating a custom form would not work, since the recipients would not have the custom form and therefore would get an error message and/or not see the letterhead logo.

This would be a change to the Notes mail file template to add the button.  It's not a custom database so I can't add forms.

.... Pentapod
0
Z_BeeblebroxCommented:
I looked into it a bit more, now that I understand what you need, and I don't see any easy way to do it. One comment though, since you are going to be modifying the mail template anyways, creating a custom form should not be a problem, since you can just have it included in the document. Alternatively, unless you will be sending messages to other people with Notes but using a different template, you can just assume that everyone will have the form since they will all be using the same template. Hope this helps.
0
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

pentapodAuthor Commented:
I think I am looking for some script to go behind the button and open the draft instead of a new memo.  I am not expecting an easy way to do it and will raise the points somewhat if anyone gives me an answer that deserves more points.

I am not going to modify the mail template so that everyone has the custom letterhead in a form, because the custom letterhead is for a specific department.  A) they wouldn't want anybody else to be able to use it, and B) if every department in every office on our Notes system wanted the template modified to have a custom form just for them, we would have hundreds of new forms and so many buttons (1 for each) there wouldn't be enough room on the screen to write a memo.  Plus I don't have access to modify all the users' templates in other regions of the company so they wouldn't necessarily receive the new forms, and if they did, the other Notes administrators would probably shoot me.

....Pentapod
0
mchampouCommented:
Hi I don't know if this is going to help ... but on my side of the planet, in my company I have an option to do something similar.

Say I have an already existing draft. I can select it and click on my Action menu. In there I have an copy called "Copy Into". If I click on "Copy Into" I am asked if I want to copy it into a new memo, a new calendar entry, etc.

If I click on "New Memo", I have a new memo with everything that was in my Draft before (Send To, Copy To, Subject, body, etc,etc).

I don't even know if this would help you. I don't even know if it's part of the standard template of Lotus. My guess is that it's now.

If this is what you want and you don't have it, I could simply copy paste the design into a database and mail it to you. (or at worse, put the answer here and type the code).

Have a good day,

mchampou
0
Z_BeeblebroxCommented:
Ok, some more comments. First of all, if you can add the button to only their template, then why not the form? Or are you going to add the button to everyone's template? That being said, the problem with this is that their is no easy way that I can see for the stationary to be identified from a script since it doesn't really have any identifying fields. What you need to do is find some way of identifying that document, either by modifying the way Notes creates personal stationary and adding a special field, or else by finding out the unique ID of the document and ensuring that everyone has the same document. To get the unique ID, right click on the document and click properties. At the bottom is a huge alpha numeric code. The first line is:

XXYYYYYYYY:YYYYYYYY-XXYYYYYYYY:YYYYYYYY

where the Y's are the ID. Just to put that in words, its skip 2 letters, take 16, skip another 2 then take the last 16. Using that code, use the following function for a button anywhere in the E-mail database, not necessarily in the drafts view. I tried it myself and I know that it works. (Don't forget the quotation marks)

@Command( [OpenDocument] ;  "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY")
0
pentapodAuthor Commented:
I tried, creating a button in the inbox and using the formula:

@Command([OpenDocument];"EBFD563E0DF41DE280256775004C1D89")

(where the original document id of the draft is "OFEBFD563E:0DF41DE2-ON80256775:004C1D89")

But all it does is open whatever document I have selected.  

Even assuming I got it to work though, using OpenDocument will only open the document, not edit it.  And, I haven't been able to test, but even if I used EditDocument wouldn't that just edit the draft, rather than creating a new email based on the draft each time?

....Pentapod
0
pentapodAuthor Commented:
MChampou - I tried your idea, but it only copies the text of the email (or draft).  What I need in a new memo is a graphic image above the addressing information, and that's not copied using your suggestion.

The custom stationery they want to use looks like this:

 __________________________________________
|                                                              |
|  this is a graphic of department letterhead  |
|                        oOoOoOo                        |
|_________________________________________|
 

To:
cc:
bcc:
Subject:

<empty text field>


0
pentapodAuthor Commented:
PS - Z_Beeblebroz - to answer your question, I can create a custom template which has a new button, and apply the template only to the department.  Then only the department has the new button.

However, if I added a new FORM, it would not work unless EVERYBODY in the company had the new form.  It would work for the department, to send the email, but the recipient who did not have the new form would get an error when they opened the email, saying the specified form does not exist.

....Pentapod
0
Z_BeeblebroxCommented:
What the open document command does, you are right, is just open the document with that ID, which in this case is the stationary. This is the way that Notes deals with Stationary. As far as I can tell, there is no way to send a memo using stationary without still being able to modify that stationary while you send it. How do you normally use stationary. If you just double click on, fill in the fields and click send, then you are doing the same thing that this button does. Let me know if I am misunderstanding how you are using stationary. And if you still cannot get the button to work, I can try another way of doing the same thing, but it will still only open the stationary.
0
pentapodAuthor Commented:
To use Stationery, I would usually go to the Drafts view, highlight the stationery, then click the "use stationery" button.

Hmm, well I just looked at the code behind that button and this is it:

@If(@IsAvailable(IsMailStationery); ""; @Return(@Prompt([OK];"Not Stationery";"This is a not a Stationery message.")));
@Command([EditDocument])

So I guess EditDocument should work without changing the original Stationery.  The problem is just referring to it.

Looks like it might be possible, I don't know why referring to the replica ID didn't work though.  I'll try some more.

....Pentapod
0
ArunkumarCommented:
Hi Pentapod,

This is an interesting situation.
I wrote an agent.  I guess you have the DocumentUniqueID of the document to refer that.  In which case you can use the following script to achieve your result.

You can add this to your action button too.

Now the script....

===================================
 Dim ws As New notesuiworkspace
     Dim ss As New notessession
     Dim db As notesdatabase
     Dim doc As notesdocument    
     Dim uidoc As notesuidocument
     
     Set db = ss.CurrentDatabase
     Set doc = db.GetDocumentByUnid("4E77E9986CABB0C3852568660015C132")
     Set uidoc = ws.EditDocument(True, doc ,False)
===================================

Good Luck !!!

:)
Arun
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Z_BeeblebroxCommented:
Why bother using a script when the @function OpenDocument does exactly the same thing given the same information: the unique ID of the document in question?
0
pentapodAuthor Commented:
Well, Arunkumar's answer works.  I can't get Zaphod's @Command button to work -

@Command([EditDocument];"EBFD563E0DF41DE280256775004C1D89")

The replica ID I copied and pasted directly from the script button that works, so I know it's correct.  The @command SHOULD work though, I don't know why it doesn't.  Zaphod, if you can figure out why your method isn't working for me I'll ask them to split the points between you, otherwise I'll have to hand it to Arunkumar.

Also, if either of you would like to suggest some script which would allow me to use the same custom letterhead in a Reply With History  I'll up the points.  (Maybe something related to MChampou's suggestion of the Copy Into button?)

....Pentapod
0
Z_BeeblebroxCommented:
One comment that might explain why it is not working... it is [OpenDocument] not[EditDocument]. I will look into your reply with history request as I have an idea as to how it might be done.

Good to know that you know my first name :)

Zaphod
0
Z_BeeblebroxCommented:
I was just looking at your comments again and I thought I should explain the difference between OpenDocument and EditDocument. EditDocument is used to open the currently selected document in edit mode, OpenDocument opens up a document with a certain Unique ID in its default mode (read-only or edit).

Zaphod.
0
pentapodAuthor Commented:
Zaphod - I did try both.

@Command([OpenDocument];EBFD563E0DF41DE280256775004C1D89)

Just opens the current document also.  Weird.

And of course I know your first name... who doesn't?  (Besides my boss I'm ashamed to say.)   I've even read "Young Zaphod Plays It Safe".

....Pentapod
0
Z_BeeblebroxCommented:
And you put the ID in quotation marks right?

Zaphod
0
pentapodAuthor Commented:
Yup, tried it both ways - just opens the current document.

....Pentapod
0
Z_BeeblebroxCommented:
Ok, I looked into the Reply with History thing and I am unable to provide a solution. The way that Notes does this is it does not use script or functions to copy the old messages in, but rather sets the Form properties of the Reply with History document to inherit the body field of the selected document when it is created into its own body field. So... if the Notes developers were incapable of using the same form (memo) to do a reply with history, instead having to create a special form, then I doubt that I will be able to find a way of doing this without a special form.

Zaphod
0
ArunkumarCommented:
Hi pentapod and Zaphod,

When i saw the question, I tried to build it using @Command.
But for somereason it did not work.  It opened only the selected document.

I tried to fool Notes and It worked.

I guess you'll have to workaround for these kinda situations.

Anyway,  Do you want me to work more for this ?

;)
Arun

PS: Antonysingh has a few points over me.  Hope I can pass thru him when you evaluate this quesion

:)
0
ArunkumarCommented:
Is this question closed ?
0
ArunkumarCommented:
Is this question closed ?
0
pentapodAuthor Commented:
Well, I was giving Zaphod some time to see if he could give the @Command to work, in which case I would have split the points. But I'll close it now, it's been almost a week.

Thanks for your answer,

....Pentapod
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.