Topic: I can not read a file htm as the text means VBA + I ask to check up pair of my functions.
It is a little prehistory - I the doctor, I do a macro for parsing of the given ultrasonics and an insertion of measurements in the protocol since to rewrite manually long and not correctly.
The pregoing version worked on Apache OpenOffice 4 (itself wrote on OOBasic), now I work in other place - is license MS Office, therefore decided to alter and refine the old version (as the scanner another and all the same the old does not work).
To what wrote - I am not engaged in programming professionally, but to my city who helps with access I can not find, therefore the part of questions will be for local old residents ridiculous.
Actually the subject - the scanner produces the data in a format htm, I by means of connected library MS HTML Object Library pull out the text, and actually I transfer a line in a parcer. But for some reason read a file htm at line I cannot.
Even if to open a notepad and to save as txt. And here if to create empty txt, to open a notepad htm to select and copy all in txt and to save, reads perfectly.
I read a line the following function:
Function GetText (sFile As String) As String Dim nSourceFile As Integer Dim sText As String Close nSourceFile = FreeFile Open sFile For Input As #nSourceFile sText = Input $ (LOF (1), 1) Close GetText = sText End Function
In nesting both test files htm and txt received by a copying method in a notepad.