Lotus Notes Cannot Locate Form...help??

amit_banore used Ask the Experts™
I have a database with the form:PrintExpenseForm which i use as a Print form for an Expense Claim. The default printer on my workstation is working fine. I use the following code to achieve this. The code is in the action button of the Expense claim document. But i get the greetings in sequence:
1) Cannot Locate Form: PrintExpenseClaim
2) Cannot locate Default Form
3) Notes Error - Cannot locate Default Form

Anyone help????

     Dim ws As New NotesUiWorkspace
     Dim cDoc As NotesDocument
     Dim uiDocument As NotesUiDocument
     Msgbox "Please switch to Landscape mode before printing.", 48, "Alert"
     Set cDoc = ws.CurrentDocument.Document
     Set uiDoc = ws.CurrentDocument
     Call cDoc.replaceItemValue ( "Form", "PrintExpenseClaim" )
     Set uiDoc = ws.EditDocument ( False, cDoc )
     Call uiDoc.Print
     Call uiDoc.Close
     Call cDoc.replaceItemValue ( "Form", "ExpenseClaim" )
     Call cDoc.replaceItemValue ( "SaveOptions", "0" )    
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I think you're missing a line something like:

Set doc = db.createdocument()    doc.Form = "Memo"

See here for further details:

This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial