microsoft's Macro Tutorial

  • View

  • Download

Embed Size (px)

Text of microsoft's Macro Tutorial

  • 8/20/2019 microsoft's Macro Tutorial



    First of all start your Microsoft oce word processor and follow the following steps:

    1. You need to make sure the developer tab is displayed

    •  he initial page is like this

    !. go to the ribbon and click it

    ". click on word options

  • 8/20/2019 microsoft's Macro Tutorial


    #ord options button

    $. the following windows appears% check the &show developer tab' that is under

    popular and click ok

    (opular tab show developer tab option )check this one*

    +click on the developer tab option that now appears on the menu bar

  • 8/20/2019 microsoft's Macro Tutorial


    +click on record macro button

    ,eveloper tab record macro button

    -. the following screen appears % click on button so that the macro should

    appear as a uick button on the access uick toolbar

    /. the following screen appears now click on the macro name you are creating

    and then click add 0: do not click or add the &separator'


  • 8/20/2019 microsoft's Macro Tutorial


    2. now you can start performing the actions you want your macro to do for e.g

    we will create a macro that will do the following:

    • create a new document

    • change the font and font si3e

    • insert a date

    1. click the ribbon and click on new then click on blank document and then

    press create

    !. note a new window document appears.

    4lick ok




  • 8/20/2019 microsoft's Macro Tutorial


    ". type some te6t and change the font and font si3e to a desired one

    $. insert date : click on insert tab and go to date and time



  • 8/20/2019 microsoft's Macro Tutorial


    -. 5 date and time window appears 4hose a desired date format and then

    click ok  

    /. he date is inserted in the document

    ,ate and

    time button

    ok button

  • 8/20/2019 microsoft's Macro Tutorial



    2. 0ow that we have done all that we want our macro to be doing % we need

    to stop recording our macro. 7o to the developers tab and click on stop


    8top recording button

  • 8/20/2019 microsoft's Macro Tutorial


    9. 0ow click on that macro button you ust created under the uick access


    ;. #hat happens< =n some programs this will work perfectly >ne but in

    some this may not be the case :

    •  Your macro will display everything you recorded in the current


    • 5fter you close every other document% try opening the word

    processor again and try running your macro again .one of these three happens 1. Your macro will run correctly !. Your micro might also produce this error

    & the reuested member of the collection does not e6ist'  his happens because in the code of your macro a certain line

    tells the macro to only apply the changes that the macro

    recorded in the document it was recorded thus if you recorded

    your macro whilst the document name was &document!' the

    macro will not run correctly in other documents.

    What you need to do  4lick on the debug button

    ?uick access


     Your macro


  • 8/20/2019 microsoft's Macro Tutorial


      he following screen appears

      You will notice a line highlighted in yellow

     ,elete that line and the above line that says

    &windows )document !*:activate'

      he code should at least look like this

    ,ebu button

  • 8/20/2019 microsoft's Macro Tutorial


     4lose the debugging window

  • 8/20/2019 microsoft's Macro Tutorial


     0ow run your micro again. =t should work perfectly >ne

    now .

  • 8/20/2019 microsoft's Macro Tutorial


    =f you have any uestions or clari>cations you know what to do .