Set Word 2007 default font values from VS2005

C

Cresta

Hello all.
Can anybody help. I have a VS2005 Word addin and would like to set words
default font values as shown when the addin starts. In the code below I
cannot work out what is to replace the ??????. Can anybody help?

Imports Extensibility
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Core
Imports Word = Microsoft.Office.Interop.Word
-----------------------------------------------------------
Sub Onstartup()
With applicationObject.ActiveDocument.Styles(?????.wdStyleNormal).font()
.Name = "Arial"
.Size = 11
.Bold = False
'etc...
End With
End sub
 
S

StevenM

To: Cresta,

Re: With applicationObject.ActiveDocument.Styles(?????.wdStyleNormal).font()

Should read: With applicationObject.ActiveDocument.Styles(wdStyleNormal).font

Or: With applicationObject.ActiveDocument.Styles("Normal").font


Steven Craig Miller
 
C

Cresta

Thanks Steven that worked.

StevenM said:
To: Cresta,

Re: With applicationObject.ActiveDocument.Styles(?????.wdStyleNormal).font()

Should read: With applicationObject.ActiveDocument.Styles(wdStyleNormal).font

Or: With applicationObject.ActiveDocument.Styles("Normal").font


Steven Craig Miller
 

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