Simply change:
Code:
If ActiveDocument.FullName = "" Then
MsgBox "activedocument not saved, exiting"
Exit Sub
Else
If MsgBox("Save Document?", vbYesNo, "Error") <> vbYes Then Exit Sub
End If
strAtt = ActiveDocument.FullName
to:
Code:
With ActiveDocument
If .FullName = "" Then
MsgBox "activedocument not saved, exiting"
Exit Sub
ElseIf .Saved = False Then
If MsgBox("Save Document?", vbYesNo, "Error") <> vbYes Then Exit Sub
.Save
End If
strAtt = Split(.FullName, ".doc")(0) & ".pdf"
.SaveAs FileName:=strAtt, FileFormat:=wdFormatPDF, AddToRecentFiles:=False
End With
(I've added a couple of minor enhancements)
PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your code loses much of whatever structure it had.