![]() |
#1
|
|||
|
|||
![]()
How can i start with macros some other macros/es?
|
#2
|
||||
|
||||
![]()
You simply call them from the macro you want to run the from. For example:
Code:
Sub Main() Call Macro1 Call Macro2("Hello World") End Sub Sub Macro1() MsgBox "Macro1 reporting for duty" End Sub Sub Macro2(strTxt As String) MsgBox strTxt End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
I found out already. I can use:
HTML Code:
Sub myMacros() SortMacroI MyB End Sub And it's not possible to start macroses from add-ins? "SpeakFromCursor" I can assign hotkey for it, but i can't start it from macros. Maybe some macros to start the same hotkey which i assign for that addin's macros? |
#4
|
||||
|
||||
![]()
The only real difference between my example and yours is that I've prefixed the macro name with Call. IMHO that makes it easier to see where the code is referencing another macro.
As for starting a macro in an addin, you'd need to both reference the addin and call its macro with all of the required parameters. Note how the second called macro in the example I posted requires a text string to be included in the call.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
i can't view addin's macro code. I want to add that command to the new tab but i can't use "callback". So what if i will assing hotkey for it, for example alt+O and then use own macro to start that hotkey combo with callback. So can you example macro to launch hotkey alt+O?
|
#6
|
||||
|
||||
![]()
For that, you could try using SendKeys:
SendKeys "%O" but do note this will only work while the document's main window is active.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ketanco | Project | 3 | 05-13-2014 07:16 AM |
![]() |
Eva | Word | 1 | 11-05-2011 01:20 PM |
![]() |
GeorgeVoudouris | Word | 4 | 09-07-2011 03:39 AM |
![]() |
zoeshaus | Outlook | 4 | 06-16-2010 12:20 PM |
Error Starting MS Help | Renee Hendershott | Office | 0 | 01-22-2006 03:40 PM |