MattAllen
asked on
Making a title bold via VB6 then continuing in non-bold for the text
Experts,
Really simple - i want my title bold in a report i am autogenerating in word from a vb app.
Why isn't the below code working?:
Set appWord = CreateObject("Word.Applica tion")
Set wrdDoc = appWord.Documents.Add
wrdDoc.Sections.PageSetup. Orientatio n = Word.WdOrientation.wdOrien tPortrait
Set oDoc = appWord.ActiveDocument
With appWord
.WindowState = Word.WdWindowState.wdWindo wStateMaxi mize
Set wordRng = wrdDoc.Range
End With
wordRng.Font.Bold = True
wordRng.Font.Underline = wdUnderlineSingle
wordRng.Font.Size = 10
strPrint = "Time Sheet and Working Time Directive" & vbCrLf
wordRng.InsertAfter strPrint
wordRng.Font.Bold = False
wordRng.Font.Underline = wdUnderlineNone
Everything comes up times new roman size 10 but nothing in bold!
Thanks for your time experts!
Really simple - i want my title bold in a report i am autogenerating in word from a vb app.
Why isn't the below code working?:
Set appWord = CreateObject("Word.Applica
Set wrdDoc = appWord.Documents.Add
wrdDoc.Sections.PageSetup.
Set oDoc = appWord.ActiveDocument
With appWord
.WindowState = Word.WdWindowState.wdWindo
Set wordRng = wrdDoc.Range
End With
wordRng.Font.Bold = True
wordRng.Font.Underline = wdUnderlineSingle
wordRng.Font.Size = 10
strPrint = "Time Sheet and Working Time Directive" & vbCrLf
wordRng.InsertAfter strPrint
wordRng.Font.Bold = False
wordRng.Font.Underline = wdUnderlineNone
Everything comes up times new roman size 10 but nothing in bold!
Thanks for your time experts!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cheers
Matt