View Single Post
 
Old 09-14-2022, 09:53 PM
TheBigBoss TheBigBoss is offline Windows 7 32bit Office 2010 32bit
Advanced Beginner
 
Join Date: Dec 2016
Posts: 56
TheBigBoss is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
What is the point of your post? If you can't see it and don't show it to us then how are we going to see it for you?

Your text file doesn't resemble the outputs in your Immediate window so you've posted a random text file and expect us to work out a character from another file which you didn't give us.

Your code opens Word only briefly to read a text file into a string - this seems like overkill? What program is the VBA code running in and why don't you just open it without needing Word. If you go to the effort of creating a Word instance then you should use it to convert the text content into a Table and just read that column of text.
Hi Guessed, thanks for your reply.
Yes, the txt file doesn't resemble the outputs as I deleted most of its content to only keep the first lines. But for sure, this is the file being problematic.

The VBA is ran on MS Word and there is much more to it, parsing the .txt file and creating an array for each line is required. Also, txt files contain content but also data, properties, bookmarks value and other stuff... It read the properties first then apply properties, then further macros are run to create content (including header/footer, table, etc) depending of property value, then content is further inserted. Agree, it could have been otherwise, like doing without txt file and putting all data in .docx properties.

Sorry if my question wasn't clear. This said, there is something in that txt file that throws a return followed by a "zero"....
Reply With Quote