I have a macro that converts single pages from a word document to a pdf, and saves them to a folder as "Page1, Page2, etc."
In between each conversion, I get a popup to Save, Don't Save, or Cancel.
Is there a way to auto select "Don't Save", so I don't have to select it between each conversion?
Sub savepdf()
Dim Counter As Long, Source As Document, Target As Document
Set Source = ActiveDocument
Selection.HomeKey Unit:=wdStory
Pages = Source.BuiltInDocumentProperties(wdPropertyPages)
Counter = 0
While Counter < Pages
Counter = Counter + 1
DocName = "Page" & Format(Counter) & ".pdf"
Source.Bookmarks("\Page").Range.Cut
Set Target = Documents.Add
Target.Range.Paste
Target.SaveAs FileName:=DocName, FileFormat:=wdFormatPDF
Target.Close
Wend
End Sub
In between each conversion, I get a popup to Save, Don't Save, or Cancel.
Is there a way to auto select "Don't Save", so I don't have to select it between each conversion?
Sub savepdf()
Dim Counter As Long, Source As Document, Target As Document
Set Source = ActiveDocument
Selection.HomeKey Unit:=wdStory
Pages = Source.BuiltInDocumentProperties(wdPropertyPages)
Counter = 0
While Counter < Pages
Counter = Counter + 1
DocName = "Page" & Format(Counter) & ".pdf"
Source.Bookmarks("\Page").Range.Cut
Set Target = Documents.Add
Target.Range.Paste
Target.SaveAs FileName:=DocName, FileFormat:=wdFormatPDF
Target.Close
Wend
End Sub