Below is my code. The object I loop through is an array of documents
data (holds paths and filenames of docs to be printed).
I'm using InterOp. It seems to lock up and never print if two or more
users try to print the same documents.
In any case, do you have an example of doing the multi thread for this
situation?
Thanks for your input.
8957078
----------------------------------------------------------------
Try
MergeDocumentAndPrint(documents, aDocumentInformation)
''Original Code Below
'If Not documents Is Nothing AndAlso documents.Count > 0
Then
' m_Word = CreateObject("Word.Application")
'Start Word and open the document template.
' m_Word.Visible = False
'Have Word run in background
' We have some files, Print Them
For Each aDocumentInformation In documents
If Not
aDocumentInformation.EndorsementLongDescription = (New
BOConstants).QUOTE_SHEET_NAME Then
Me.PrintDocument(aDocumentInformation.FileName)
End If
Next
Me.CloseWinWord() 'Clean Up
End If
Catch ex As Exception
Me.CloseWinWord()
Me.CreatePrintingException("The following error received
while attempting to print a document: " & _
ex.ToString)
End Try
----------------------------------------------------------------
"Fergus Cooney" <fi******@tesco.net> wrote in message news:<#e**************@TK2MSFTNGP10.phx.gbl>...
Hi 8957078,
Unusual handle you've got there! ;-)
I think <your program> is going to have to be that spooler.
What's the objection to looping through your Word.Prints? If it's because
your app can't do anything until all the printing is done, then I would
suggest learning just how easy** it can be to do it in a separate Thread.
When you say 'multiple users ... at the same time', what do you mean,
exactly?
Regards,
Fergus
** 'easy' - a relative term, but I would hope that you'd be nicely surprised.
:-)