This is the click event of a command button on a user form, PrintPage which refers to checkboxes (each named Section#)to print selected sections of a document. It works fine except I get a blank page after some of the printouts. I added MoveLeft to reduce the selection but it makes no difference. Any ideas?
For Each ctrl In PrintPage.Controls
If Left(ctrl.Name, 7) = "Section" Then
If ctrl.Value = True Then
n = CInt(Right(ctrl.Name, Len(ctrl.Name) - 7))
ActiveDocument.Sections
.Range.Select
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
ActiveDocument.PrintOut Range:=wdPrintSelection
End If
Selection.HomeKey Unit:=wdStory
End If
Next ctrl
For Each ctrl In PrintPage.Controls
If Left(ctrl.Name, 7) = "Section" Then
If ctrl.Value = True Then
n = CInt(Right(ctrl.Name, Len(ctrl.Name) - 7))
ActiveDocument.Sections
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
ActiveDocument.PrintOut Range:=wdPrintSelection
End If
Selection.HomeKey Unit:=wdStory
End If
Next ctrl