Based on another question, that I asked here :
How to insert a macro in a Word-VBA using python?
The output of the word Macro is a .doc file.
I manually have to copy the contents of this .doc file using ctrlA+ctrlC and then copy it using ctrlV in a Text editor(Notepad++)
Thereafter , when saving the file , I use ANSI Encoding, and goto the EOL ,to select UNIX EOL.
What I need to do, is convert the above manual process to be a part of my vb script.
Dim rng As Range
Dim MainDoc As Document
Dim strFile As String
Const strFolder = "d:\Userfiles\msultana\Desktop\PRORATION\PMP_Automation\PMP_June\" 'change to suit
Set MainDoc = Documents.Add
strFile = Dir$(strFolder & "*.doc") ' can change to .docx
Do Until strFile = ""
Set rng = MainDoc.Range
rng.InsertFile strFolder & strFile
strFile = Dir$()
MsgBox ("Files are merged")
' Accept all tracking changes (PTR 10078844)
Dim stry As Object
For Each stry In ActiveDocument.StoryRanges
If stry.Revisions.Count >= 1 Then _
' Save file in new format
ActiveDocument.SaveAs2 FileName:="proviso.raw.June2016", _
MsgBox ("Save file in new format ANSI UNIX EOL")
However, the file size and format differ when I try to do this manually, and by using the VB Script above.I have tried that below.
Can you please help me improve this script and/or correct it ?
Since I am calling this macro from a python script, I am also open to solutions from python as well.
I am new to macros and VB script.