I need help I am getting an error saying:Option strict on disallow late binding.
It seems like it's asking me to turn option strict off this is my code:
Expand|Select|Wrap|Line Numbers
- ' Procedure to Write the Word documents content into RTF
- Public Sub WriteToRTF()
- Try
- Dim eWord, oWord As Object
- Dim iCount As Integer
- ' Create Word Object
- eWord = CreateObject("Word.Application")
- If Not eWord Is Nothing Then
- ' Open the Word file
- oWord = eWord.Documents.Open(gstNamingDocumentPath)
- ' Get the Line count for the current document
- iCount = oWord.ComputeStatistics(Word.WdStatistic.wdStatisticCharactersWithSpaces)
- iCount = iCount / 65
- ' Assign the Line count value
- txtLineCount.Text = iCount
- ' Write to RTF named as output.rtf
- mobjOutputFile = Application.StartupPath & "\output.rtf"
- 'Save as doc file 0.doc into 0.rtf format
- oWord.SaveAs(mobjOutputFile, 6)
- oWord.Close()
- ' Load the Rtf file in to txtword
- txtWord.LoadFile(mobjOutputFile)
- 'Check a running instance is found
- eWord.Quit()
- System.Runtime.InteropServices.Marshal.ReleaseComObject(eWord)
- ' Clear the Word Object
- eWord = Nothing
- End If
- Catch ex As Exception
- AppendtoLog(ex)
- End Try
- End Sub