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
MergeDocumentAn dPrint(document s, aDocumentInform ation)
''Original Code Below
'If Not documents Is Nothing AndAlso documents.Count > 0
Then
' m_Word = CreateObject("W ord.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 aDocumentInform ation In documents
If Not
aDocumentInform ation.Endorseme ntLongDescripti on = (New
BOConstants).QU OTE_SHEET_NAME Then
Me.PrintDocumen t(aDocumentInfo rmation.FileNam e)
End If
Next
Me.CloseWinWord () 'Clean Up
End If
Catch ex As Exception
Me.CloseWinWord ()
Me.CreatePrinti ngException("Th e following error received
while attempting to print a document: " & _
ex.ToString)
End Try
----------------------------------------------------------------
"Fergus Cooney" <fi******@tesco .net> wrote in message news:<#e******* *******@TK2MSFT NGP10.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.
:-)