Printing Crash

J

John

I'm busy converting a vba procedure to VB.NET this afternoon. My latest
problem is printing the document to Distiller (which worked fine in VBA).
It's getting caught up on the following line (and unfortunately I don't get
to see the ex error as I get an error message from the print queue app and
Visio stops responding! Any clues?):

vDoc.PrintOut(VisPrintOutRange.visPrintFromTo, 1, fPgCount, , "Acrobat
Distiller")

Thanks

John

PS - I've not got a reference to Distiller in the .NET app (just incase
that's important.....)

Sub PrintForegroundPages(ByVal vDoc As Document)

Try

Dim fPgCount As Integer = 0 'Foreground page count

Dim vsoPages As Pages

Dim vsoPage As Page

Dim intCounter As Integer

'Get the Pages collection.

vsoPages = vDoc.Pages

'Iterate through the collection.

For intCounter = 1 To vsoPages.Count

'Retrieve the Page object at the current index.

vsoPage = vsoPages(intCounter)

'Check whether the current page is a background page.

If vsoPage.Background = False Then

fPgCount = fPgCount + 1

End If

Next intCounter

'Print out foreground pages

vDoc.PrintOut(VisPrintOutRange.visPrintFromTo, 1, fPgCount, , "Acrobat
Distiller")

Catch ex As Exception

System.Windows.Forms.MessageBox.Show(ex.Message)

End Try

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top