Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-11-2015, 10:59 PM
Guessed's Avatar
Guessed Guessed is offline what functions would this task use, format, macro ? etc Windows 7 32bit what functions would this task use, format, macro ? etc Office 2010 32bit
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

Based on your provided sample, the following macro would do it all. You may also need to modify the character style 'Emphasis' to get it to look blue.
Code:
Sub FormatText()
 
  With AutoCorrect
    .CorrectInitialCaps = True
    .CorrectSentenceCaps = True
    .CorrectDays = True
    .CorrectCapsLock = True
    .ReplaceText = True
    .ReplaceTextFromSpellingChecker = True
    .CorrectKeyboardSetting = False
    .DisplayAutoCorrectOptions = True
    .CorrectTableCells = True
  End With
 
  With Options
    .AutoFormatApplyHeadings = True
    .AutoFormatApplyLists = True
    .AutoFormatApplyBulletedLists = True
    .AutoFormatApplyOtherParas = True
    .AutoFormatReplaceQuotes = True
    .AutoFormatReplaceSymbols = False
    .AutoFormatReplaceOrdinals = False
    .AutoFormatReplaceFractions = False
    .AutoFormatReplacePlainTextEmphasis = False
    .AutoFormatReplaceHyperlinks = True
    .AutoFormatPreserveStyles = True
    .AutoFormatPlainTextWordMail = True
  End With
 
  ActiveDocument.Range.Style = "Normal"
  ActiveDocument.Kind = wdDocumentNotSpecified
  ActiveDocument.Range.AutoFormat
 
  With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Replacement.Style = ActiveDocument.Styles("Emphasis")
    .Text = "\(*\)"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = True
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute Replace:=wdReplaceAll
 
    .Text = ""
    .Replacement.ClearFormatting
    .Style = ActiveDocument.Styles("Body Text")
    .Replacement.Style = ActiveDocument.Styles("List Number")
    .Execute Replace:=wdReplaceAll
  End With
 
End Sub
And you also should edit the Heading 1 style to get those headings to your desired look too.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
macro, template, vb



Similar Threads
Thread Thread Starter Forum Replies Last Post
what functions would this task use, format, macro ? etc Macro to format unpredictable data Nisio07 Excel 2 09-30-2014 01:16 PM
what functions would this task use, format, macro ? etc Copy and Paste of a Task...Including all of the Task's 'children'...to a new task KRTSTARRYNIGHT Project 1 07-01-2014 06:54 AM
what functions would this task use, format, macro ? etc Find and Replace Format macro issue Jack Word VBA 2 12-12-2012 09:24 PM
what functions would this task use, format, macro ? etc macro to format this ubns Word 3 04-24-2012 11:44 PM
what functions would this task use, format, macro ? etc Need a macro to convert all graphics to GIF format sleake Word VBA 3 02-10-2012 05:00 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:04 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