![]() |
|
#1
|
||||
|
||||
![]()
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 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 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.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Thanks for the quick response. My issue is resolved. I have an additional question relating to the conversion.
I created a legacy control box that the user will click to start the MS-Word to Pdf conversion. Is it possible to remove the control box from appearing on the pdf document or will I need the user need to utilize a keyboard shortcut to run the macro? |
![]() |
Tags |
email, pdf |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
zooeyhall | Word | 2 | 10-01-2015 06:22 AM |
![]() |
Catty | Word VBA | 1 | 12-11-2013 03:57 PM |
![]() |
Esgrimidor | Word VBA | 11 | 12-03-2012 03:44 PM |
![]() |
gonner | Word | 1 | 09-10-2011 03:25 AM |
![]() |
vijayaram | Word | 1 | 12-30-2009 08:25 AM |