Change how Word formats a .txt file

G

geekgrrl

Hello,

I am trying to open a .txt file in Word. The .txt file was created on
a mainframe and can be up to 134 characters wide. Is there no way that
I can get this document to display properly upon opening?

If I open the document, change the font used for Plain Text style to be
Courier New 8 point instead of Courier New 10 point, and change the
page layout to Letter Landscape, my mainframe txt file fits on the
page.

I can change (and have changed) the Plain Text style to always be
Courier New 8 point, and change my Normal.dot to have all my documents
automatically open in Letter Landscape with 1" margins. This does not
work when I open a .txt file using Word. It formats the plain text as
if it was letter portrait and places it smack in the middle of my
Letter Landscape page (basically increasing the L/R margins from 1" to
2.17")

Is there a way to change how Word opens and formats a .txt file?
Without having to run extra macros and whatnot? I have a tool that
creates TIFF files by automating the opening and printing txt files
using Word to a special virtual printer, and if I can get Word to open
the .txt file in the format/layout I need then I can use my tool to
automatically convert my (many) txt files to the TIFF files I need.

Thanks,
Sheri
 
K

Klaus Linke

Hi,

No idea why Word acts that way...
It looks like a bug or very weird design to me.

You could save the document you have formatted the way you like it as a
template, say Text.dot.
Then next time you usually would open a text file, instead create a new
(empty) document based on that template, and use "Insert > File" to insert
the text.

Regards,
Klaus
 
T

Terry Farrell

That seems weird and not my experience with Word. Word should wrap your text
automatically: there should be no need to mess around with margins,
orientation or fonts. Are you sure that you haven't enabled the Wrap to
Windows option?
 
G

geekgrrl

Terry,

Thanks for the answer. Normally Word does wrap my text for me. The
problem here seems to be how Word treats plain text (unformatted)
files. Whenever I open a plain text file Word wants to wrap it at 80
characters, no matter what my page layout is. My text file is actually
134 characters wide as it comes from mainframe. You could duplicatate
this by creating a text file in notepad that is greater than 80
characters wide and seeing what happens when you double-click to open
that txt file in Word. My file does have the extension .txt and not
..doc.

Thanks again,
Sheri
 
G

geekgrrl

Klaus,

Thanks for taking the time to answer.
Normally what you suggested would work, but I have lots of these types
of files that I need to convert to TIFF images and I was hoping to find
a way to use a batch conversion tool that I already have.

Thanks again,
Sheri.
 
G

Graham Mayor

This is not normal behaviour. Word will wrap the text to the current
margins. If the wrap is fixed at 80 characters then there is a hard return
at 80 characters. You can establish this by pressing SHIFT+* to display the
formatting characters.There will only be a paragraph mark at the end of each
true line. If there are more paragraph marks then you should check your
mainframe output as it appears to be wrapping at 80 characters.

If you want to send me one of your documents to check, then do so to the
link on my web site.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Poprivet

geekgrrl said:
Klaus,

Thanks for taking the time to answer.
Normally what you suggested would work, but I have lots of these types
of files that I need to convert to TIFF images and I was hoping to
find a way to use a batch conversion tool that I already have.

Thanks again,
Sheri.

Have you tried Wordpad with the Wrap setting where you want it?

With Word, you may have to use Paste Special; have you looked it?

Pop`
 
G

geekgrrl

Graham,

Thanks for the reply.

When I display the formatting characters, the paragraph mark is at the
end of the line, not where Word wraps the text, so I don't think it is
the mainframe output.

The text file is 134 chars wide with paragraph markers at the end of
each line where I want them. If I load the .txt file, change my Plain
Text style to Courier 8pt and default my page setup to be Letter
Landscape with T/L/R/B margins of 0.5", my mainframe page displays
correctly. I save my style change, and make my current page setup the
default, and close Word. If I open the same file again by
double-clicking on it,or throught File-Open the margins are
automatically adjusted to 2.83" L/R and the file is wrapped.

I can send you the file to look at. I'll send it from your website.

Thanks in advance for your help.
Sheri
 
D

Doug Robbins - Word MVP

You are not saving the changes in the file that you are opening. The
changes that you have saved as defaults will only apply to new documents.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
G

Graham Mayor

I have had a look at the document you sent me. There is nothing amiss with
that and if you open it in Word, provided there is enough space between the
margins it will wrap correctly. I have posted a macro solution to you that
will do just that.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

geekgrrl

Graham,

Wow! Thank you for the macro solution - with your help I was able to
get Word to format the .TXT file the way I wanted it upon opening.
With the macro in place I could use my conversion tool to create TIFF
files from all my mainframe text files.

Thanks again so much. You're a life saver.
Sheri.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top