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

RE: Set Word 2007 default font values from VS2005 by stevencraigmiller(at)comcast(dot)net>

stevencraigmiller(at)comcast(dot)net>
Thu Jul 17 11:42:04 PDT 2008

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


"Cresta" wrote:

> 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
>
>

RE: Set Word 2007 default font values from VS2005 by Cresta

Cresta
Fri Jul 18 01:38:02 PDT 2008

Thanks Steven that worked.

"StevenM" wrote:

> 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
>
>
> "Cresta" wrote:
>
> > 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
> >
> >