Created
February 16, 2016 18:18
-
-
Save DaKeZhang7412/3a3227bd93e4fe4cd017 to your computer and use it in GitHub Desktop.
Convert words into PDFs in batch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub converttopdf() | |
' | |
' converttopdf Macro in batch | |
' https://msdn.microsoft.com/en-us/library/office/aa220734(v=office.11).aspx | |
' | |
' | |
Dim strDocName As String | |
Dim intPos As Integer | |
For Each aDocument In Application.Documents | |
strDocName = aDocument.Name | |
intPos = InStrRev(strDocName, ".") | |
strDocName = Left(strDocName, intPos - 1) | |
strDocName = strDocName & ".pdf" | |
aDocument.SaveAs FileName:=strDocName, FileFormat:=wdFormatPDF | |
Next aDocument | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment