Public
Function
AddSubject(DocNewFilee
As
Document, strSubject
As
Variant
,
Optional
intGlid
As
Variant
)
Dim
i
As
Integer
DocNewFilee.Activate
If
intGlid = 1
Then
Selection.Range.Paragraphs.Style = ActiveDocument.Styles(wdStyleHeading1)
Selection.Font.Bold =
True
Selection.Font.Size = 20
Selection.Font.Name =
"Arial"
Selection.Font.Italic =
False
Selection.TypeText (strSubject & vbCrLf)
ElseIf
intGlid = 2
Then
Selection.Range.Paragraphs.Style = ActiveDocument.Styles(wdStyleHeading2)
Selection.Font.Bold =
True
Selection.Font.Size = 20
Selection.Font.Name =
"Arial"
Selection.Font.Italic =
False
Selection.TypeText (strSubject & vbCrLf)
ElseIf
intGlid = 3
Then
Selection.Range.Paragraphs.Style = ActiveDocument.Styles(wdStyleHeading3)
Selection.Font.Bold =
True
Selection.Font.Size = 18
Selection.Font.Name =
"Arial"
Selection.Font.Italic =
False
Selection.TypeText (strSubject & vbCrLf)
ElseIf
intGlid = 4
Then
Selection.Range.Paragraphs.Style = ActiveDocument.Styles(wdStyleHeading4)
Selection.Font.Bold =
False
Selection.Font.Size = 18
Selection.Font.Name =
"Arial"
Selection.Font.Italic =
False
Selection.TypeText (strSubject & vbCrLf)
ElseIf
intGlid = 5
Then
Selection.Range.Paragraphs.Style = ActiveDocument.Styles(wdStyleHeading5)
Selection.Font.Bold =
False
Selection.Font.Size = 18
Selection.Font.Name =
"Arial"
Selection.Font.Italic =
False
Selection.TypeText (strSubject & vbCrLf)
ElseIf
intGlid = 6
Then
Selection.Range.Paragraphs.Style = ActiveDocument.Styles(wdStyleHeading6)
Selection.Font.Bold =
False
Selection.Font.Size = 18
Selection.Font.Name =
"Arial"
Selection.Font.Italic =
False
Selection.TypeText (strSubject & vbCrLf)
ElseIf
intGlid = 7
Then
Selection.Range.Paragraphs.Style = ActiveDocument.Styles(wdStyleHeading7)
Selection.Font.Bold =
False
Selection.Font.Size = 18
Selection.Font.Name =
"Arial"
Selection.Font.Italic =
False
Selection.TypeText (strSubject & vbCrLf)
End
If
End
Function