Opening document with specified font

D

Dudley

I have code on a command button to open a text file:

Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Open "c:\My Documents\New Incorporation\Output\tags.txt"

This opens in Courier New 10.5 and I would like it to open in 9. Is there
code I can use to specify the font size?

Thanks for any help.
Dudley
 
D

Daniel Pineault

You really should ask a question regarding programming Word in a Word forum.
You are much more likely to get the help you seek there.

If you google ms word vba set font size you'll find many examples to learn
from.

That said, you could however try something like:
oApp.Selection.Font.Size = 9.5
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
D

Dudley

I did ask first in a Word forum and was advised that it is not possible as
formatting is not preserved in a text document. I also tried googling but
none of the solutions I found worked. Your suggestion does work if I put
first

oApp.Selection.WholeStory

Thanks very much for your help.
 

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