Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 09-14-2022, 09:53 PM
TheBigBoss TheBigBoss is offline Reading basic .txt file fails, how can it be? Windows 7 32bit Reading basic .txt file fails, how can it be? Office 2010 32bit
Advanced Beginner
Reading basic .txt file fails, how can it be?
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
The “spelling and grammar” check fails to work as the number of words in the file exceeds a certain Jamal NUMAN Word 3 09-24-2019 10:45 AM
Reading basic .txt file fails, how can it be? Need plugin for reading+converting *.pdf file into *.doc pstein Word 1 05-24-2015 07:05 AM
Reading pane on TOP? hehunt Outlook 0 04-10-2014 06:34 AM
Reading basic .txt file fails, how can it be? How to save a PPT file in 'Reading View' to be opened always in 'Reading View' ItzVickey PowerPoint 2 08-08-2012 09:23 AM
Reading basic .txt file fails, how can it be? Word Basic 2003 to Word Basic 2007 Incompatibility Mark1110 Word VBA 1 12-29-2010 11:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft