Advertisement

[x]
Attachment Details

Print all Documents in a View to PDF

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6
Zone: Lotus Notes
Tags: ,
Greetings,

I am trying to print all the documents in a particular View in a given NSF. I am doing this in VB.Net by using late binding calls. Attached please find the code.

This code works fine for small NSF files, but if the NSF file contains more than 500 documents, the program crashes. I am not sure if this is a late binding issue with .Net or if its something in my code.

Please do advice if there is a better way to print the docs to pdf or the code above can be tweaked.

Any help will be greatly appreciated.

Thanks in advance.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
'variable declarations
 
Dim notesSession As Domino.NotesSession
Dim notesDBDir As Domino.NotesDbDirectory
Dim notesDatabase As Domino.NotesDatabase
Dim notesView As Domino.NotesView
Dim notesDoc As Domino.NotesDocument
 
 
Dim ws As Object
Dim WSObj As Object
Dim UIDBObj As Object
Dim DBObj As Object
Dim DocObj As Object
Dim notesUIWorkspaceType As Type
 
Dim args1(0) As Object
Dim args2(5) As Object
Dim args3(0) As Object
Dim args4(0) As Object
Dim nc As Int16
Dim resObj As Object
 
 
 
public subPrintAllDocs_Inbox()
 
'Front End Classes
 
ws = CreateObject("Notes.NotesUIWorkspace")
Call ws.OpenDatabase("", "test.nsf")
 
notesUIWorkspaceType = Type.GetTypeFromProgID("Notes.NotesUIWorkspace")
 
WSObj = Activator.CreateInstance(notesUIWorkspaceType)
UIDBObj = notesUIWorkspaceType.InvokeMember("CurrentDatabase", Reflection.BindingFlags.GetProperty, Nothing, WSObj, Nothing)
 
DBObj = notesUIWorkspaceType.InvokeMember("Database", Reflection.BindingFlags.GetProperty, Nothing, UIDBObj, Nothing)
 
 
'Back End Classes
 
'Open a Session and initialize it
notesSession = New Domino.NotesSession()
notesSession.Initialize()
 
'Get the database Directory
notesDBDir = notesSession.GetDbDirectory("")
 
'Get the Database
notesDatabase = notesDBDir.OpenDatabase("test.nsf")
If Not (notesDatabase.IsOpen) Then
    notesDatabase.Open()
End If
 
'Get the ($Inbox) View
notesView = notesDatabase.GetView("($Inbox)")
 
'Start Printing Documents
notesDoc = notesView.GetFirstDocument()
 
While Not (notesDoc Is Nothing)
 
   args1(0) = CType(notesDoc.UniversalID, System.Object)
   DocObj = notesUIWorkspaceType.InvokeMember("GetDocumentByUNID", Reflection.BindingFlags.InvokeMethod, Nothing, DBObj, args1)
 
   args2(0) = CType(False, System.Object)
   args2(1) = CType(DocObj, System.Object)
   args2(2) = CType(True, System.Object)
   args2(3) = CType("", System.Object)
   args2(4) = CType(True, System.Object)
   args2(5) = CType(False, System.Object)
   resObj = notesUIWorkspaceType.InvokeMember("EditDocument", Reflection.BindingFlags.InvokeMethod, Nothing, WSObj, args2)
 
   nc = 1
   args3(0) = CType(nc, System.Object)
   notesUIWorkspaceType.InvokeMember("PRINT", Reflection.BindingFlags.InvokeMethod, Nothing, resObj, args3)
 
 
   args4(0) = CType(False, System.Object)
   notesUIWorkspaceType.InvokeMember("CLOSE", Reflection.BindingFlags.InvokeMethod, Nothing, resObj, args4)
 
   notesDoc = notesView.GetNextDocument(notesDoc)
 
End While
 
End Sub
Related Solutions
Related Solutions
 
Loading Advertisement...
 

Rank: Genius

Expert Comment by SysExpert:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by sval1411:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 

Rank: Genius

Expert Comment by qwaletee:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by sval1411:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by sval1411:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 

Rank: Genius

Expert Comment by qwaletee:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Author Comment by sval1411:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 

Rank: Genius

Accepted Solution by qwaletee:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
Loading Advertisement...
20080924-EE-VQP-41 / EE_QW_2_20070628