Thread: [Solved] Docx to rtf
View Single Post
 
Old 02-06-2022, 01:39 PM
spillerbd spillerbd is offline Windows 10 Office 2013
Competent Performer
 
Join Date: Jan 2016
Posts: 130
spillerbd is on a distinguished road
Default

You are not defining the FIle name correctly. ActiveDocument.Name
Code:
Sub rtf_test()

Dim strFname As String
Dim oDoc As Document
Dim strPath As String

    strFname = "Filename"
    Set oDoc = ActiveDocument
    strPath = ActiveDocument.Path & "\"
    
   oDoc.SaveAs2 FileName:=strPath & ActiveDocument.Name & ".rtf", FileFormat:=wdFormatRTF
   
      
End Sub
Reply With Quote