DEV Community

Oscar Sun(孫守真字任真)
Oscar Sun(孫守真字任真)

Posted on

Answer: Is there a VBA macro that will convert a word document to hard coded formatting?

Please try this code first to see if it meets your expectations

Sub RemoveStyleKeepFormatting_Is_there_a_VBA_macro_that_will_convert_a_word_document_to_hard_coded_formatting()
    Dim doc As Document, t As Range, s As Style
    Dim ur As UndoRecord
    Dim ft As Font
    Set ur = Word.Application.UndoRecord
    ur.StartCustomRecord "RemoveStyleKeepFormatting"
    Set doc = ActiveDocument
    Dim r As Range
    Set r = doc.StoryRanges(wdMainTextStory)

Top comments (0)