Changing Font

R

Richard Grene

I am using Word automation from vb.net. Any idea how to insert text at the
bolltom of the document and make only that text a new font?

Thanks,
Richard
 
H

Harold Kless[MSFT}

Hi Richard,
I used this code within a button click event .
Dim oWord As Word.Application
Dim oDoc As Word.Document
Const wdStory = 6
oWord = New Word.Application
oWord.Visible = True
'add a new document
oDoc = oWord.Documents.Add
'move the selection point to the end of the document
oWord.Selection.EndKey(wdStory)
'add text then format it with Font Arial size 12 pts.
With oWord.Selection
.InsertAfter("This is a test")
.Range.Font.Name = "Arial"
.Range.Font.Size = 12
End With
Harold Kless, MCSD
Support Professional
Microsoft Technical Support for Business Applications
(e-mail address removed)

--


This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 

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