M
Mark Holland
Hello,
I am trying to put MS Word COM Objects in to a VBScript - I am struggling
with a bit of translation.
Basically I want to alter a Heading style.....
I use Word Macro to get me the code, which is....
objSelection.Style = ActiveDocument.Styles("Heading 1")
With ActiveDocument.Styles("Heading 1").ParagraphFormat
.LeftIndent = CentimetersToPoints(1.27)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 12
.SpaceBeforeAuto = False
.SpaceAfter = 3
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.WidowControl = True
.KeepWithNext = True
.KeepTogether = False
.PageBreakBefore = False
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = CentimetersToPoints(-0.63)
.OutlineLevel = wdOutlineLevel1
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
End With
How do I put that in to VBScript??
I understand I have to create the object and create a new document (as below)
set objword = CreateObject("Word.Application")
objword.visible = True
set objDoc = objword.Documents.Add()
set objSelection = objWord.Selection
What else do I need to do??
Many Thanks in advane
Mark Holland
I am trying to put MS Word COM Objects in to a VBScript - I am struggling
with a bit of translation.
Basically I want to alter a Heading style.....
I use Word Macro to get me the code, which is....
objSelection.Style = ActiveDocument.Styles("Heading 1")
With ActiveDocument.Styles("Heading 1").ParagraphFormat
.LeftIndent = CentimetersToPoints(1.27)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 12
.SpaceBeforeAuto = False
.SpaceAfter = 3
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.WidowControl = True
.KeepWithNext = True
.KeepTogether = False
.PageBreakBefore = False
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = CentimetersToPoints(-0.63)
.OutlineLevel = wdOutlineLevel1
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
End With
How do I put that in to VBScript??
I understand I have to create the object and create a new document (as below)
set objword = CreateObject("Word.Application")
objword.visible = True
set objDoc = objword.Documents.Add()
set objSelection = objWord.Selection
What else do I need to do??
Many Thanks in advane
Mark Holland