The following VBA code functionality, step one, adds text dzwebs text to the top of Word's current document. Then, set the first paragraph to center, and then add a half inch spacing after the paragraph. The Dzwebs format is set to 36 points, the Arial font.
Dim Rngformat as Range
Set Rngformat = ActiveDocument.Range (start:=0, end:=0)
With Rngformat
. InsertAfter text:= "Dzwebs"
. InsertParagraphAfter
With. Font
. Name = "Official script"
. Size = 36
. Bold = True
End With
End With
With Activedocument.paragraphs (1)
. Alignment = wdAlignParagraphCenter
. SpaceAfter = InchesToPoints (0.5)
End With
Part of the code explains:
Dim Rngformat as Range definition variable
Set Rngformat = ActiveDocument.Range (start:=0, end:=0) sets the position of the Rngformat variable, located at the top of the document
With Rngformat
Inside the code function is to set font size and other properties
End With
With Activedocument.paragraphs (1)
. Alignment = wdAlignParagraphCenter
. SpaceAfter = InchesToPoints (0.5)
End With
The code function is to add a segment after a distance of 0.5 inches