Thread: [Solved] Docx to rtf
View Single Post
 
Old 02-06-2022, 10:04 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

What you need is
Code:
Sub rtf_test()
Dim oDoc As Document
Dim strPath As String
    Set oDoc = ActiveDocument
    oDoc.Save
    If Not ActiveDocument.path = "" Then
        strPath = ActiveDocument.FullName
        strPath = Left(strPath, InStrRev(strPath, Chr(46))) & ".rtf"
        oDoc.SaveAs2 FileName:=strPath, FileFormat:=wdFormatRTF
    Else
        oDoc.SaveAs2 FileName:="Filename.rtf", FileFormat:=wdFormatRTF
    End If
    Set oDoc = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote