Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2015, 04:41 AM
electrocad electrocad is offline How to print a line of text with all available fonts in the same document Windows 7 64bit How to print a line of text with all available fonts in the same document Office 2007
Novice
How to print a line of text with all available fonts in the same document
 
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
  #2  
Old 10-17-2015, 04:53 AM
gmayor's Avatar
gmayor gmayor is offline How to print a line of text with all available fonts in the same document Windows 7 64bit How to print a line of text with all available fonts in the same document Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,103
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

See http://word.mvps.org/FAQs/Formatting...eGenerator.htm and if you don't know how to use that listing, see http://www.gmayor.com/installing_macro.htm
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to print a line of text with all available fonts in the same document Can I manage line spacing when using different fonts? zany Word 3 07-03-2015 05:32 AM
Save Every 2 pages of Word Document as the First Line of Text Faugs Word VBA 6 08-13-2014 11:50 PM
Print copies of onepage document with different text kciejek Word VBA 4 06-03-2014 03:21 AM
How to print a line of text with all available fonts in the same document Print Layout View Differs from Print Preview & Printed Document terik222 Word 3 03-27-2013 02:43 PM
Changing Fonts Within a Document Elementninja111 Word 1 06-21-2012 06:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft