Thanks Steve. This shows the printdialog box but after we make our settings
and click OK it will print watever we have in print range ,but I need to
print like 80% of the slides which have specific tags and renumebr them using
a differnt code so what I need is a way to show the user some of printer
current settings and ability to change them ( in particcular I need to show
differnt printers installed in a machine in a dropdown and ability to change
them).
It's a long code but I'm pasting it here to show what I really need to do.
Sub printSlide(sldNum As Long)
With ActivePresentation.PrintOptions
.RangeType = ppPrintSlideRange
With .Ranges
.ClearAll
.Add Start:=sldNum, End:=sldNum
End With
.NumberOfCopies = 1
.Collate = msoTrue
.OutputType = ppPrintOutputSlides
.FitToPage = msoFalse
.FrameSlides = msoFalse
End With
ActivePresentation.PrintOut
End Sub
Sub PrintWithoutFlypage()
Dim osld As Slide
Dim lx As Long
Dim oShp As Shape
Dim lCount As Long
lCount = 0
On Error GoTo errorhandler
For Each osld In ActivePresentation.Slides
osld.HeadersFooters.SlideNumber.Visible = msoFalse
Next
Call DeletePath <---- call to a method to delet certain elements
'This line prints coverpage
Call printSlide(ActivePresentation.Slides(1).SlideNumber) <--- call to
the first method for printing.
'I used the Ubound slide number of the last slide which is difefrent than
slideindex
'Of the last slide because we statrt at 0
For lx = 2 To ActivePresentation.Slides.Count
If ActivePresentation.Slides(lx).Tags.Count = 0 Then
lCount = lCount + 1
If ActivePresentation.PageSetup.SlideWidth = 780 Then
Set oShp =
ActivePresentation.Slides(lx).Shapes.AddTextbox(msoTextOrientationHorizontal,
756, 523.44, 15.84, 24.48)
Else
'Make sure this setting is working for A4size too
Set oShp =
ActivePresentation.Slides(lx).Shapes.AddTextbox(msoTextOrientationHorizontal,
700.46, 523.44, 12.24, 18)
End If
With oShp.TextFrame
.MarginBottom = 0
.MarginLeft = 0
.MarginRight = 0
.MarginTop = 0
.WordWrap = msoFalse
End With
With oShp.TextFrame.TextRange
.Text = lCount
.Font.Name = "Trade Gothic LT Std"
.Font.Size = 10
.ParagraphFormat.Alignment = ppAlignCenter
.ParagraphFormat.WordWrap = msoFalse
End With
Call printSlide(ActivePresentation.Slides(lx).SlideNumber)
oShp.Delete
ElseIf ActivePresentation.Slides(lx).Tags.Count > 0 Then
If ActivePresentation.Slides(lx).Tags.Name(1) = "PREFACE" Then
lCount = lCount + 1
If ActivePresentation.PageSetup.SlideWidth = 780 Then
Set oShp =
ActivePresentation.Slides(lx).Shapes.AddTextbox(msoTextOrientationHorizontal,
756, 523.44, 15.84, 24.48)
Else
Set oShp =
ActivePresentation.Slides(lx).Shapes.AddTextbox(msoTextOrientationHorizontal,
700.46, 523.44, 12.24, 18)
End If
With oShp.TextFrame
.MarginBottom = 0
.MarginLeft = 0
.MarginRight = 0
.MarginTop = 0
.WordWrap = msoFalse
End With
With oShp.TextFrame.TextRange
.Text = lCount
.Font.Name = "Trade Gothic LT Std"
.Font.Size = 10
.ParagraphFormat.Alignment = ppAlignCenter
.ParagraphFormat.WordWrap = msoFalse
End With
Call printSlide(ActivePresentation.Slides(lx).SlideNumber)
oShp.Delete
End If
End If
Next
For Each osld In ActivePresentation.Slides
osld.HeadersFooters.SlideNumber.Visible = msoTrue
Next
Exit Sub
errorhandler:
MsgBox Err.Description, vbCritical, CompName
End Sub