Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open a new document from lotusScript?

Status
Not open for further replies.

medwards

Programmer
Nov 9, 2001
8
US
Hi. I am replacing the formula code of a button with LotusScript. The only thing I'm having a problem with is opening a new document. The formula used is:

@Command( [Compose] ; "" ; "Main Form" ) ;

I know I can't use Evaluate(). How can I open the new "Main Form" document in LotusScript?
Thanks.
 
The following code will create a new Memo in your mail database.


Dim workspace As New notesuiworkspace

'-- Leaving the first and second options blank will open the form "Memo" in the current database

Call workspace.ComposeDocument( "", "", "Memo" )


Good luck,

Craig
 
here is an example of how to open a new document in lotusscript, this code has been placed in a hotspot-button. I added some comments so you can see what things are, I hope this helps.
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace 'set new workspace
Dim uidoc As NotesUIDocument 'fornt end of document
Set uidoc = workspace.currentdocument 'set current document
Dim reason As Variant 'define variable
Dim database As Variant 'define variable
Dim server As Variant 'define variable
database="" 'name of notes database between quotes
server="" 'name of server running on between quotes
Set uidoc = workspace.ComposeDocument(server,database,"FORM_NAME") 'compose document with the form called in the FORM_NAME code section.

the main advantage of doing it this way you can also create a new document in a seperate database if you use the DATABASE and SERVER entries.

If you have more problems let me know and I will try to help you out.
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top