Solved

ComposeDocument not working on R5

Posted on 2004-10-01
4
374 Views
Last Modified: 2013-12-18
I have a form (that will not be saved - saveoptions field set to 0). This form has a button that should open a new form and then paste certain values into fields on this new form. Here is part of my code on this button:
                Dim workspace As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument      
      Set uidoc = workspace.CurrentDocument
                Call uidoc.GoToField( "CoName" )
      Call uidoc.SelectAll
      Call uidoc.Copy
      Call uidoc.Close
      Set uidoc = workspace.ComposeDocument("","","MyNewForm")
      Call uidoc.GotoField("Company")
      Call uidoc.Paste

I am working in Domino 6. The code is working perfectly on the Notes6 Client, but gives an error on the Notes 5 client. Everything works except the ComposeDocument part. I get an error: "Invalid Formula: unknown function/operator" and when clicked OK: "Unable to find document Window".

I don't want to fiddle too much with the rest of the code, because there are all kinds of other things that are dependent on the copy and pasting, etc. Any help would be appreciated, as this is getting quite urgent and my launch date is around the corner.

THANKS!!
0
Comment
Question by:Zenoe
  • 2
4 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 75 total points
ID: 12199116
Copy/Paste is not required. It is far better to work with NotesItems.

     Dim workspace As New NotesUIWorkspace
     Dim uidoc As NotesUIDocument    
    Dim newuidoc As NotesUIDocument    
    Dim doc As NotesDocument
    Dim newdoc As NotesDocument
   
     Set uidoc = workspace.CurrentDocument
    Set doc= uidoc.Document
     Set newuidoc = workspace.ComposeDocument("","","MyNewForm")
    Set newdoc= newuidoc.Document
    newuidoc.Company= doc.CoName(0)
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12199877
There is a timing issue that has always been associated with compose command in R6 and R5.. the tab window behaviour are little different in both versions.. Sjef version should work as you don't involve two uidocs in a sequence...

Or other soln is to compose document in queryclose event of the form...For that you have to mention that it need to compose doc by setting some global variable.

~Hemanth
0
 

Author Comment

by:Zenoe
ID: 12199986
Thanks guys. It turns out that my problem was actually associated with the new form I was opening. This form had one field on it that called a function new to R6 - thus the error. I found Sjef's answer very helpfull though, and will award the points to him.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12200323
"Award" and "with a C" are in EE an oxymoron. Might I suggest to ask for a PAQ/Refund (in Community Support) next time when you find the answer yourself? That won't hurt my feelings as much...

Sjef ;)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

758 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now