C
Cheese_whiz
Hi all,
How do I apply formatting (bold, for example) to text created during a sub
in access that automates word.
For example, this code will open word, create a new document, add the date
(right aligned), start a new paragraph (left aligned). How would I bold the
date from this sub? Is there a way to refer to current sentence or current
paragraph without knowing sentence or paragraph numbers (like using count
property or something)?
Sub OpenWordDoc()
Dim objWord As Word.Application
Dim objDoc As Word.Document
Set objWord = New Word.Application
objWord.Visible = True
Set objDoc = objWord.Documents.Add
objWord.Activate
objWord.Selection.TypeParagraph
objWord.Selection.InsertDateTime
objWord.Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
objWord.Selection.TypeParagraph
objWord.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
objWord.Selection.TypeText ""
End Sub
Thanks for any help,
CW
How do I apply formatting (bold, for example) to text created during a sub
in access that automates word.
For example, this code will open word, create a new document, add the date
(right aligned), start a new paragraph (left aligned). How would I bold the
date from this sub? Is there a way to refer to current sentence or current
paragraph without knowing sentence or paragraph numbers (like using count
property or something)?
Sub OpenWordDoc()
Dim objWord As Word.Application
Dim objDoc As Word.Document
Set objWord = New Word.Application
objWord.Visible = True
Set objDoc = objWord.Documents.Add
objWord.Activate
objWord.Selection.TypeParagraph
objWord.Selection.InsertDateTime
objWord.Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
objWord.Selection.TypeParagraph
objWord.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
objWord.Selection.TypeText ""
End Sub
Thanks for any help,
CW