?
Solved

smarticon to create a button to open a new memo using specific stationary

Posted on 2003-03-28
12
Medium Priority
?
937 Views
Last Modified: 2007-12-19
Hello,
I would like to create a smarticon which will create a new message using a specific stationary.
Does anyone know the code/formula to use within this smart icon or where C could go for help on this coding?

Thank You!
Suzanne
0
Comment
Question by:Alesso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
12 Comments
 
LVL 45

Expert Comment

by:patrickab
ID: 8226248
Suzanne - Please let us know the application software you are using and in which you would like to create the smart icon - patrickab
0
 
LVL 1

Author Comment

by:Alesso
ID: 8226405
Im sorry, it is in Lotus Notes Mail R5
0
 
LVL 45

Expert Comment

by:patrickab
ID: 8226963
Thanks for that Suzanne. I'm afraid I have no experience on it so someone else will need to help.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 45

Expert Comment

by:patrickab
ID: 8230096
If Notes has a script recording facility why not record one to do what you want, save it and then attach it to a macro button. In other Lotus applications that's how it is done. To create a new macro button all you need to do is go into file/iconsetup/editicon/createnewicon and then make your icon, save it after having put a description against it, attach the script to it and that's about it. Oh, I think you may need to add it to the icon bar and save that set of icons so that it appears every time.

Hope that helps
0
 
LVL 13

Accepted Solution

by:
CRAK earned 200 total points
ID: 8253914
I'm afraid that it cannot be done!
Smarticons can only be programmed using @-functions. And none is suitable for this purpose.
Notes does that (under the tools button) in Lotusscript (kind of VB).

The only option is to grab the Lotusscript code, copy it into an agent, modify it where neccessary and launch it from a smarticon, but all depends on wether or not you're allowed to create/run your own lotusscript agents.
0
 
LVL 1

Author Comment

by:Alesso
ID: 8254080
It appears that I can create an agent, how do i get the lotusscript code?
0
 
LVL 13

Expert Comment

by:CRAK
ID: 8256332
The original code in the button is:

Sub Click(Source As Button)
     Dim session As New notessession
     Dim uiws As New notesuiworkspace
     Dim collection As notesdocumentcollection
     Dim noteUIEditDocument As notesuidocument
     Dim database As NotesDatabase
     
     Set noteCursorDoc = session.currentdatabase.createdocument
     Set database = session.currentdatabase
     
     Set collection = uiws.Picklistcollection(PICKLIST_CUSTOM, False, database.server, database.filepath, "Stationery", "Select Stationery", "Please select stationery for new memo.")
     Set noteCursorDoc = collection.getfirstdocument
     If Not noteCursorDoc Is Nothing Then
          Set noteUIEditDocument =  uiws.Editdocument(False, noteCursorDoc)
     End If
End Sub

If you copy/paste the everything from the first "Dim" up to End If, you could put that straight into the initialize section of your agent. The agent would then do the exact same thing as the button.

No if you have a stationary called "MyTemplate", and you'd want that one to launch, we need to change some bits. The agent's code would look like this:

Sub Initialize
     Dim session As New notessession
     Dim uiws As New notesuiworkspace
     Dim noteUIEditDocument As notesuidocument
     Dim database As NotesDatabase
     Dim stView As NotesView
     Dim stEntries As NotesViewEntryCollection
     Dim stEntry As NotesViewEntry
     Dim noteCursorDoc As NotesDocument
     Dim Found As Integer
     
     Set noteCursorDoc = session.currentdatabase.createdocument
     Set database = session.currentdatabase
     
     Set stView = database.GetView("Stationery")
     Set stEntries = stView.AllEntries
     Found = False
     Set stEntry = StEntries.GetFirstEntry
     Do While Not (stEntry Is Nothing) And found = False
          If Ucase(stEntry.ColumnValues(5)) = Ucase("myTemplate") Then
               ' Ucase for case insensitive compare, column 5 (view starts at 0) holds stationery name
               Found = True ' stop searching
               Set noteCursorDoc = stEntry.Document
          End If
          Set stEntry = StEntries.GetNextEntry(stEntry)
     Loop
     
     If Not noteCursorDoc Is Nothing Then
          Set noteUIEditDocument =  uiws.Editdocument(False, noteCursorDoc)
     End If
End Sub

Name the agent "Default stationery", make it "run from agents list" and set it to "run once". The code is in Lotusscript (not Formula, Java or whatever other options you have there).

Now the last step....
Pick an empty (macro) smarticon, and assign folowing formula:

@Command([FileOpenDatabase]; @MailDbName);
@Command([ToolsRunMacro]; "(Default stationery)")

It'll first open your mail database (or we won't be able to reach the agent) and then trigger the new agent in it.

Enjoy!
0
 
LVL 1

Author Comment

by:Alesso
ID: 8263703
Where do I put the code in the agent? I dont see anywhere it should be, there is the action box but i cant paste anything in it, and there is another box i can type in but when I select "run once" it disappears...
0
 
LVL 13

Expert Comment

by:CRAK
ID: 8267490
That's what I meant... you may not be allowed to create lotusscript agents...

When creating a new agent you see following fields (right hand side, top to botton):
- Name (text, 1 line) + button ("Options")
- Shared agent (checkbox)
- When should this agent run (select "Manually from agents list") + button "Schedule" (may be inactive)
- Which documents should it act on (Select "Run once")
- Then there is an area to refine a search (using the button "Add search...")
Then there is a horizontal line, indicating the end of the frame (you can move it up and down).
In the lower frame you see:
- (in bold) the name of the agent
- Run (select "Lotusscript" and the frame should split horizontally)
- In the (new) left pane, select "Initialize"
- In the right you should enter (copy/paste) the code.
0
 
LVL 13

Expert Comment

by:CRAK
ID: 8312041
Where do you get stuck Alesso?

If creating an agent causes a problem, there may be another way out. Can you look into the design of the folder "($Inbox)"? In the action pane you'll find the definition for the button: "Tools\New Memo - Using Stationery". If you can see the code, you might be able to copy the button and edit it.... Try copy/paste and rename it in the property box. Replace the code with a simple oneliner:

Sub Click(Source As Button)
    Messagebox "Hello world!"
End Sub

If that works, we could create a customised button with the exact function that you want and forget about the smarticon.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question