iknowu99
Well-known Member
- Joined
- Dec 26, 2004
- Messages
- 1,158
- Office Version
- 2016
Hello Excellers,
I wrote a script to convert Word Doc to text and I need help removing characters that are non ascii. Everything saved to the text needs to be within 0-255 ascii and if there are characters that are not then they are removed.
I wrote a script to convert Word Doc to text and I need help removing characters that are non ascii. Everything saved to the text needs to be within 0-255 ascii and if there are characters that are not then they are removed.
Code:
Sub wrdDocTest()
Dim wd As Word.Application
Dim wDoc As Word.Document
Set wd = New Word.Application
Set wDoc = wd.Documents.Open(Range("A2").Value) 'MS Word data
'here need step to remove non 0-255 ASCII characters from wDoc object
Call wDoc.SaveAs(Replace(Range("A2"), ".docx", ".txt"), wdFormatDOSText, , , , , , , , , , ,
wDoc.Close
Set wDoc = Nothing
wd.Quit
Set wd = Nothing
End Sub