Wednesday, August 5, 2009

MacroLabs | Creating Your First Macro

1. To create a new macro file, create a new document in your Microsoft Word Application.

2. Press [alt] + [F11] in your keyboard to open the Visual Basic Editor.

3. From the project list, Click 'ThisDocument' and type the codes below.

Private Sub Document_Open()
Dim msg As String
msg = "Hello World!"
MsgBox msg
End Sub


4. Click the Play Button to run the macro.


Note: If you are kinda familiar with Visual Basic, you would not find it hard to develop macro in MS Word.

No comments:

Post a Comment