What is the new line marker in an uploaded Word doc?
- by Donde
I am attempting to uplaod a Word doc and then write it line by line in HTML. I made a referecne to the Microsoft Word Object Library. Then I use the following code to grab the and put it in a string variable. However, I have tried multiple regex statements to replace the new line character with "" but nothing I have tried has worked...
Dim wordApp As New Microsoft.Office.Interop.Word.Application
Dim wordDoc As New Microsoft.Office.Interop.Word.Document
Dim file As Object = "C:\test.doc"
Dim nullobj As Object = System.Reflection.Missing.Value
wordDoc = wordApp.Documents.Open(file, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, nullobj)
Dim strArticle As String = wordDoc.Content.Text
'It's not finding the new line marker here
strArticle = Regex.Replace(strArticle, ControlChars.NewLine, "<BR>")