View Single Post
 
Old 10-17-2015, 04:41 AM
electrocad electrocad is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Oct 2015
Posts: 1
electrocad is on a distinguished road
Default How to print a line of text with all available fonts in the same document

Hello Word People,
First Post!.
Some kind soul over at the Powershell.com site suggested that I use this code :-

$word = New-Object -ComObject "Word.Application"
$word.Visible = $true
$document = $word.Documents.Add()
foreach ($name in $word.FontNames ) {
$p = $document.Paragraphs.Add();
$p.Range.Text = $name
$p.Range.Font.Name = $name
$p.Range.InsertParagraphAfter();
}


I have no idea how to use this code, could someone help me please.

Thanks

electrocad
Reply With Quote