Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Msg Box at end of Macro
Hi,
I'd like to put a message box at the end of a macro indicating that the macro ran. Can someone help me, I keep getting compile errors. (Expected =) MsgBox(prompt:="Verbiage Changed", Buttons:=vbOkOnly, Title:="Finished") TIA! |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Msg Box at end of Macro
Leave out the parenthesis:
MsgBox Prompt:="Verbiage Changed", Buttons:=vbOKOnly, Title:="Finished" -- Regards Lene Fredborg - Microsoft MVP (Word) DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "Karin" wrote: Hi, I'd like to put a message box at the end of a macro indicating that the macro ran. Can someone help me, I keep getting compile errors. (Expected =) MsgBox(prompt:="Verbiage Changed", Buttons:=vbOkOnly, Title:="Finished") TIA! |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Msg Box at end of Macro
Karin wrote:
Hi, I'd like to put a message box at the end of a macro indicating that the macro ran. Can someone help me, I keep getting compile errors. (Expected =) MsgBox(prompt:="Verbiage Changed", Buttons:=vbOkOnly, Title:="Finished") TIA! Just remove the parentheses, leaving a space between MsgBox and prompt. The explanation (sort of) is at http://www.word.mvps.org/FAQs/Macros...ithArgmnts.htm. By including parentheses around the parameter list, you're implying to VBA that it's a function (part 2 of the article), and a function has to be on the right side of an equal sign so that its return value can be put somewhere. That's why it says it's expecting an equal sign. Because you aren't using any return value, you're calling MsgBox as a sub (part 3 of the article), which means you shouldn't have parentheses. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Spell Check a protected Form with a Macro & already have forms picture macro | Microsoft Word Help | |||
Macro cannot be found or has been disabled because of Macro settin | Microsoft Word Help | |||
Pause an executing Word Macro to enter info and then Macro continu | Microsoft Word Help | |||
macro runs from keyboard, but not from macro button-why? | Microsoft Word Help | |||
2000 to 2002 macro and "Could not open macro storage" | Mailmerge |