[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Word 2007 VBA Macros Disappear

Posted on 2009-12-21
Medium Priority
Last Modified: 2013-11-25
I have a bunch of macros written in VBscript that I run from a Macro-Enabled Word Document (.DOCM) in MS Word 2007.

In general, all of my macros work, except one that I recently changed to accept an argument/function parameter. This is designed to allow me to parameterize an existing function. For some reason, whenever I give my vba macros the ability to use function parameters, they disappear on me. Any suggestions?

Thank you,

The code is:

Sub RunMyFavMacro(sParam1 As String)
End Sub

Open in new window

Question by:dogbertius

Accepted Solution

suvmitra earned 2000 total points
ID: 26104494
Insert the below code and run this code instead.
Sub RunFavMac()
call RunMyFavMacro
End Sub

Author Closing Comment

ID: 31668801
There is another post on here (which I can't find anymore) which described setting a .param field

Basically, with VB in Word (2007) I can't directly pass formal function parameters as I could in a stronger language like C. Instead, I need to define .param  entries and then issue lengthy callbacks. Good thing this is a simple app :)

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Suggested Courses
Course of the Month18 days, 22 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question