View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default Calling a private sub in Outlook via toolbar button

Hi sapphire,

sapphire wrote:
I need to add a button to my outlook toolbar called "send and file".
This button needs to call a subroutine that will send the message and
allow a user to choose a folder to save the message to (other than the
sent items). My subroutine is working correctly. However, I am
unable to link it to the toolbar because it is a private subroutine.
How can I trigger a private subroutine from a toolbar button?


I assume you're talking about Outlook VBA, not Excel. Regardless, there's
no way to call a Private subroutine from any location other than the module
itself. So you'd either need a Public wrapper subroutine, or you'll need to
make your routine Public. What's the reason for making it Private? If it's
to keep users from seeing it in a run macros dialog, you can use Option
Private Module at the top of the code module, which will hide it from that
dialog. (not sure if this applies to Outlook)

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]