Sunteți pe pagina 1din 12

Hi

First of all start your Microsoft office word processor and follow the following steps:
1. You need to make sure the developer tab is displayed
The initial page is like this

2. go to the ribbon and click it

3. click on word options

Word options button


4. the following windows appears, check the show developer tab that is under
popular and click ok

Popular tab

show developer tab option (check this one)

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

-click on record macro button

Developer tab

record macro button

5. the following screen appears , click on button so that the macro should
appear as a quick button on the access quick toolbar

Button

6. the following screen appears now click on the macro name you are creating
and then click add
NB: do not click or add the separator

Your
macro

Add
button

7. now you can start performing the actions you want your macro to do for e.g
Click ok
we will create a macro that will do the following:
create a new document
change the font and font size
insert a date
1. click the ribbon and click on new then click on blank document and then
press create

2. note a new window document appears.

3. type some text and change the font and font size to a desired one

Font
Font
change

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

Date and
time button

5. A date and time window appears Chose a desired date format and then
click ok

ok button

6. The date is inserted in the document

7. Now that we have done all that we want our macro to be doing , we need
to stop recording our macro. Go to the developers tab and click on stop
recording

Stop recording button

8. Now click on that macro button you just created under the quick access
toolbar

Your macro
button
Quick access
toolbar

9. What happens? In some programs this will work perfectly fine but in
some this may not be the case :
Your macro will display everything you recorded in the current
document
After 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
2. Your micro might also produce this error
the requested member of the collection does not exist
This 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 document2 the
macro will not run correctly in other documents.
What you need to do
Click on the debug button

Debug button

The following screen appears

You will notice a line highlighted in yellow


Delete that line and the above line that says
windows (document 2):activate
The code should at least look like this

Close the debugging window

Now run your micro again. It should work perfectly fine


now .

If you have any questions or clarifications you know what to do .


Byeee

S-ar putea să vă placă și