This is weird (for me anyway) ! When I try to print 1 or 2 pages, everything works just perfect. From the third page, the document is full of errors and missing parts. It can't be the document itself, because when I change the i variable to 3, there is no problem. It can't be the printer's memory, because I halted the program after each page, with the same errors as result. So in my opinion, it has to be in the code. Any help would be welcome, I really need this one to work. (I use Word2000)
Code:
Dim oWord As Word.Application
Set oWord = CreateObject("Word.Application")
With oWord
.Options.AutoFormatAsYouTypeReplacePlainTextEmphasis = False
If Pages = 1 Then
.Documents.Open (AppPath & DocName)
.PrintOut False '(not in background)
.ActiveDocument.Close
Else
For i = 1 To Pages
If optSpelType(0).Value = True Then
.Documents.Open (AppPath & DocName & " - Part " & i)
Else
.Documents.Open (AppPath & DocName & " - Poule " & i)
End If
.PrintOut False '(not in background)
.ActiveDocument.Close
Next
End If
.Quit
End With
Set oWord = Nothing[\code]
Sfenx8-)