Default Font Face and Size for .txt

C

cmsix

I have low vision and am not able to read the Courier New font Microsoft Word
defaults to when opening an existing .txt file. That is the only type file I
use Word on .txt

I understand that word can not obtain font face and size information when
opening a .txt file. Why doesn't it use the defaults for a new .txt file
then.

How can I make Microsoft Word default to opening .txt files in the font face
and size I want it too.

I realize this is a common mistake made by word processors. OpenOffice and
Abiword have the same behavior. When opening an existing .txt document the
ignore the default font face and size specified by the user and open the
existing document in a font face and size specified by who? The obvious
answer is specified by someone who doesn't have ny trouble with their vision.

I was able to cure Abiword of this fault by editing the executable with
UltraEdit. When I tried that with word's executable I found it didn't contain
font names in human readable form.

So, is there a way to tell word to open existing .txt files in my preferred
font face and size. If not, can you tell me where the arbitrarily selected
font face and size for opening existing .txt files is located?

cmsix
 
G

Graham Mayor

Text files do not (as you appear to realise) store font information and uses
the monospaced font Courier New to present the text. Word use the plain text
paragraph style to format text files, but while you can change the font size
on that style and have that reflected in the documents, Word will not
automatically adopt a different font face. You can however force it to do
so, by changing the plain text style in normal.dot to whatever you require
and add the following lines to an autoopen macro in normal.dot which will
force the display of whatever font you have setup in that style.

If LCase(Right(ActiveDocument.name, 3)) = "txt" Then
With Selection
.WholeStory
.Font.Reset
.HomeKey Unit:=wdStory
End With
End If

See http://www.gmayor.com/installing_macro.htm

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

cmsix

Graham Mayor said:
Text files do not (as you appear to realise) store font information and uses
the monospaced font Courier New to present the text. Word use the plain text
paragraph style to format text files, but while you can change the font size
on that style and have that reflected in the documents, Word will not
automatically adopt a different font face. You can however force it to do
so, by changing the plain text style in normal.dot to whatever you require
and add the following lines to an autoopen macro in normal.dot which will
force the display of whatever font you have setup in that style.

If LCase(Right(ActiveDocument.name, 3)) = "txt" Then
With Selection
.WholeStory
.Font.Reset
.HomeKey Unit:=wdStory
End With
End If

See http://www.gmayor.com/installing_macro.htm

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Thank you for your attempt to help. I created the macro, named it autopen
and then tried to open an exixting text document. It still opened in Courier
New 10pt.

Hoping I had named it incorrectly I tried running the macro after the
document was open. It did nothing.

any other hints?

cmsix
 
G

Graham Mayor

cmsix said:
Thank you for your attempt to help. I created the macro, named it
autopen and then tried to open an exixting text document. It still
opened in Courier New 10pt.

Hoping I had named it incorrectly I tried running the macro after the
document was open. It did nothing.

any other hints?

cmsix

The macro forces the document to adopt the settings in the underlying style
i.e. Plain Text. It won't do anything unless you change the style definition
of the Plain Text style. I suspect you will also have to set Windows
Explorer to display extensions of known file types also. I have not tested
it without.

Call the macro Autoopen - not Autopen!

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

cmsix

I hope top posting is ok.

While I was looking for where to change the style I stumbled onto the record
macro button and the steps that came out to

Selection.WholeStory
Selection.Font.Name = "Verdana"
Selection.Font.Size = 14

It isn't automatic, but after figuring out how to put a button in the extra
space it is almost as good and I can go back to fiction and just make up
things that work right automagically.

Thanks for your guidance though. It led me to a good solution.

cmsix
 
G

Graham Mayor

You could combine the two and make it automatic:

Sub Autoopen()
If LCase(Right(ActiveDocument.name, 3)) = "txt" Then
With Selection
.WholeStory
.Font.Name = "Verdana"
.Font.Size = 14
.HomeKey Unit:=wdStory
End With
End If
End Sub

This relies on text documents being named filename.txt and would ignore
other documents.
http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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