'unable to wrap text in word document using VBA

I have an input text file(Line size and column size varies). I want to convert it into document with the same format(same length as in text file, not to span to the next line if the input line has more data). My sample input file has 2 lines (added Line1, Line2 for reference). When I try to convert this text file into word doc, the lines are moved to the next line however, I want the word file also in the same format and length as in text file. Is there a way to do like this?

Line1:    asd,aasdfa,afdsasd,asdfas,adfas,asdfa,d                                        ,asdfasdafasdfa,afdas                ,asdfadfasd               23423,    Chan
Line2:    home                                                 asfda                                   Date:13-05-2020    Time: 00:00:00                                                                                                                        daateafsd

This is my vba code

    Dim inp_dir As String
    Dim inp_file_name As String
    Dim inp_file As String
    inp_dir = "C:\Users\HP\OneDrive\Desktop\"
    inp_file_name = "file1.txt"
    
     
    
    Dim wdApp As Word.Application
    Set wdApp = AttachToMSWordApplication
    
     
    inp_file = inp_dir & inp_file_name
    Debug.Print "currently opening " & inp_file

    Dim wdDoc As Word.Document
    Set wdDoc = wdApp.Documents.Open(Filename:=inp_file, _
                                         ReadOnly:=True, _
                                         AddToRecentFiles:=False, _
                                         Format:=wdOpenFormatAuto, _
                                         Visible:=False)
     Dim out_file As String
     out_file = Replace(inp_file, ".txt", ".doc")
     Debug.Print "saving as " & out_file
     wdDoc.SaveAs2 Filename:=out_file
     wdDoc.Close False



     


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source