Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Macro in word  (Read 3706 times)

0 Members and 1 Guest are viewing this topic.

Wilma

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Windows 10
    Macro in word
    « on: February 28, 2020, 10:46:05 PM »
    I would like to a create a macro that changes three sentences of text into three different styles – for example the
    The article titles should be style ‘Heading 1’ – sentence one
    The authors of the article should be style ‘Emphasis’ – sentence two
    and the pagination of the article should be in style 'Intense re...' - sentence three

    (Please note I’ve used these styles as an example. Actual styles being used are in-house created ‘styles’)
    So, I’ve ‘recorded’ this action (see below), when running the macro it is only changing the first sentence to the requested style, my other instructions are ignored – so basically the Macro does not recognize my other instructions – which should be that after each carriage return there is a new sentence which should be ‘styled’ accordingly.
    Is this something I’m able to do with a macro or am I being to ambitions? Please note - I cannot dictate what the format of the original text is, as I’m bringing in data from various sources.

    My Macro reads:
    Sub BulletinStyle()
    '
    ' BulletinStyle Macro
    '
    '
        Selection.Style = ActiveDocument.Styles("Heading 1")
        Selection.Style = ActiveDocument.Styles("Emphasis")
        Selection.Style = ActiveDocument.Styles("Intense Reference")
    End Sub


    Any help is appreciated
    Regards,
    Wilma