Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-25-2018, 08:41 AM
apollox apollox is offline Macro for Font Names and Sizes Windows 7 64bit Macro for Font Names and Sizes Office 2013
Novice
Macro for Font Names and Sizes
 
Join Date: Apr 2018
Posts: 3
apollox is on a distinguished road
Default Macro for Font Names and Sizes

I am very new to macros and I am learning and rookie at vba. I am trying to write a macro which will detect if the document has uniform font size and using same font except for Title page and headings. If any sentence has a different size or different font name then a comment should be added automatically saying check font size or name. For example.



This is an example to test the font sizes macro

If something like this appears then a comment should be automatically added saying check the font name or size. I dont know how to embed about font name so far it only checks font size.

Code:
Sub CheckFonts()

  Dim objSingleWord As Range
  Dim objDoc As Document
  Dim mycomment As Object
 
  Set objDoc = ActiveDocument
 
  With objDoc
    For Each objSingleWord In .Words
      If objSingleWord.Font.Size > 10 Then
        objSingleWord.Font.Size = 10
            mycomment.AddComment "here a comment"
    .Comment.Visible = False
      End If
    Next
  End With
End Sub
This is what I have so far but instead of writing a comment it is changing the font size and doesn't detect the font name.

Any help is much appreciated.

Thank you in advance
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 08:29 AM.


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