Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 06-13-2018, 06:00 AM
Guessed's Avatar
Guessed Guessed is offline Macro for Font Names and Sizes Windows 10 Macro for Font Names and Sizes Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Assuming you only want to test font sizes and typefaces from the first heading onwards, you could use code like this
Code:
Sub CommentMania()
  Dim aRng As Range, aPara As Paragraph
  Set aRng = ActiveDocument.Range.GoTo(What:=wdGoToHeading, Which:=wdGoToFirst, Count:=1)
  aRng.End = ActiveDocument.Range.End
  For Each aPara In aRng.Paragraphs
    If Left(aPara.Style.NameLocal, 7) <> "Heading" Then
      If aPara.Range.Font.Size <> 10 Then
        ActiveDocument.Comments.Add aPara.Range, "Check font size"
      ElseIf aPara.Range.Font.Name <> "Arial" Then
        ActiveDocument.Comments.Add aPara.Range, "Check typeface"
      End If
    End If
  Next aPara
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
macro vba word



Similar Threads
Thread Thread Starter Forum Replies Last Post
Same selection of font..different sizes... Garyz Word 8 02-02-2016 09:13 AM
Change font sizes in template Calab PowerPoint 1 12-23-2013 09:29 AM
Reply: huge font sizes... Uli Outlook 3 09-19-2012 06:57 PM
Font sizes in Outlook 2003 peterandrew Outlook 3 09-18-2012 04:26 AM
Changing all different font sizes by a value Puffin617 Word VBA 6 05-21-2009 08:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:15 PM.


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