From: Dudley on
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
From: Daniel Pineault on
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.



"Dudley" wrote:

> 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
From: Dudley on
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.

"Daniel Pineault" wrote:

> 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.
>
>
>
> "Dudley" wrote:
>
> > 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