Solved

ComposeDocument not working on R5

Posted on 2004-10-01
4
380 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
[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
  • 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Word Pro Conversion utility 13 40
Creating a new theme in discussion8.ntf 6 190
Lotus Domino 9.0 install on same pc with 8.5.3 9 141
Installing Lotus Notes on Citrix XenApp 3 189
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Suggested Courses

739 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