ChuckDrago
Active Member
- Joined
- Sep 7, 2007
- Messages
- 470
- Office Version
- 2010
- Platform
- Windows
Hi everyone,
I am trying to get a Word document to open (so that it updates its date) and then save it to a designated folder as a pdf. I tried to adapt a great macro I got in this forum but to no avail. Here is the code, thus far:
<code/>Sub SubTest()
Dim Pth As String, Fname As String
Pth = "C:\Latex Free Holder"
Fname = "Cover Letter"
Dim objWord
Dim objDoc
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("L:\Intranet Elements\Latex Free Masters\Latex Free Cover Letter.docx")
objWord.Visible = True
objWord.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Pth & Fname, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub</code>
The error occurs in the export statement. I tried ActiveDocument, objWord and objDoc as starters, but nothing seems to work. Errors go from Object required to Method not supported.
Any suggestions will be much appreciated, as always,
Chuck
I am trying to get a Word document to open (so that it updates its date) and then save it to a designated folder as a pdf. I tried to adapt a great macro I got in this forum but to no avail. Here is the code, thus far:
<code/>Sub SubTest()
Dim Pth As String, Fname As String
Pth = "C:\Latex Free Holder"
Fname = "Cover Letter"
Dim objWord
Dim objDoc
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("L:\Intranet Elements\Latex Free Masters\Latex Free Cover Letter.docx")
objWord.Visible = True
objWord.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Pth & Fname, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub</code>
The error occurs in the export statement. I tried ActiveDocument, objWord and objDoc as starters, but nothing seems to work. Errors go from Object required to Method not supported.
Any suggestions will be much appreciated, as always,
Chuck