Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub convert()
Dim doc As Word.Document
Dim old As String
Dim docpath As String
Dim pspath As String
Dim newdoc As String
Dim psfile As String
docpath = "C:\temp"
pspath = "C:\tmp"
old = Application.ActivePrinter
Application.ActivePrinter = "Generic Postscript Printer"
Set doc = ActiveDocument
newdoc = DestPath(docpath, doc.Name)
psfile = DestPath(pspath, PSName(doc.Name))
doc.SaveAs newdoc
doc.PrintOut False, False, , psfile, , , , , , , True
Set doc = Nothing
Application.ActivePrinter = old
End Sub
Private Function DestPath(sPath As String, sName As String) As String
Dim oFSO As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")
DestPath = oFSO.BuildPath(sPath, sName)
Set oFSO = Nothing
End Function
Private Function PSName(sDocName As String) As String
Dim oFSO As Object
Dim sName As String
Set oFSO = CreateObject("Scripting.FileSystemObject")
sName = oFSO.GetBaseName(sDocName) ' strip extension
PSName = sName & ".ps"
Set oFSO = Nothing
End Function