View Single Post
 
Old 06-13-2018, 06:00 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 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