Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 09-17-2018, 11:57 PM
nsv nsv is offline Windows 8 Office 2013
Novice
 
Join Date: Jul 2010
Location: Denmark
Posts: 17
nsv is on a distinguished road
Default Open macro selector (ALT+F8) in VBA

I wonder if it is possible to make a Word document start with the macro selector (ALT+F8) activated; something like this:
Code:
Private Sub Document_Open()

 MsgBox "Instruction:" & vbNewLine & _
 "" & vbNewLine & _
 "This document is a template with a number of macros for selecting the relevant icons."

ShowMacroSelector = True

End Sub
Of course this one does not work, but I hope you get the idea. I know that the instruction 'ShowVisualBasicEditor = True' works, but that is not what I am after.



NSV
Reply With Quote
  #2  
Old 09-18-2018, 12:04 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,755
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

Code:
Dialogs(wdDialogToolsMacro).Show
will show the macro dialog, but there are much better ways of making macros readily available to documents e.g. creating a custom ribbon tab.
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 09-18-2018, 12:04 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,166
Guessed has a spectacular aura aboutGuessed has a spectacular aura aboutGuessed has a spectacular aura about
Default

Is it this dialog you are looking for?
Code:
Sub ShowMacros()
  Dialogs(wdDialogToolsMacro).Display
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia

Last edited by Guessed; 09-18-2018 at 12:05 AM. Reason: Drat: Beaten by Graham yet again
Reply With Quote
  #4  
Old 09-18-2018, 06:34 AM
nsv nsv is offline Windows 8 Office 2013
Novice
 
Join Date: Jul 2010
Location: Denmark
Posts: 17
nsv is on a distinguished road
Default

Excellent!!! Thank you very much.

Now I just wonder - how did you know this is the code? I have googled and searched and digged without finding the answer and I would like to be able to find this kind of information in a systematic way.
Reply With Quote
  #5  
Old 09-18-2018, 05:16 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,166
Guessed has a spectacular aura aboutGuessed has a spectacular aura aboutGuessed has a spectacular aura about
Default

I don't have a system. It comes with following these types of forums over 20+ years. Start with a google search and read items that sound close and then try refining your search with keywords that look like they are heading in the right direction. As you read more, you learn what keywords work better than others.

For this one, I just typed directly into the VBA editor "Dialogs(" and then used Intellisense to view all the options until I find one that looks about right.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #6  
Old 09-18-2018, 08:05 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,755
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

See https://docs.microsoft.com/en-us/pre...30(v=office.11) It's an old link but still appropriate and gives you the switches appropriate to each command.
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #7  
Old 09-18-2018, 10:53 PM
nsv nsv is offline Windows 8 Office 2013
Novice
 
Join Date: Jul 2010
Location: Denmark
Posts: 17
nsv is on a distinguished road
Default

Thanks for the tips

NSV
Reply With Quote
  #8  
Old 09-19-2018, 04:29 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,468
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by gmayor View Post
I get a 404 not found error with that link. Try: https://docs.microsoft.com/en-us/pre...1(v=office.14)
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #9  
Old 09-19-2018, 08:07 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,755
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

Hmmm. That's odd. The link as posted produces a 404 error yet I copied it from the address bar of my browser where the expanded link works Thanks for the replacement link.
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #10  
Old 09-19-2018, 08:43 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,468
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

I think the forum software helpfully put your closing ) outside the URL...
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #11  
Old 09-20-2018, 12:59 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,755
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

That would explain it
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Open to a Website When No Document Is Open lostinwebspace Word VBA 1 02-13-2016 10:28 AM
MS Word 2010 Table Selector Selects Header On One Page and Rows On Next Page scptech Word Tables 4 01-11-2016 02:55 PM
can I run a macro when I open a specific doc ?? ximpostor Word VBA 10 10-12-2012 12:35 PM
macro to open another document coconutt Word VBA 1 06-11-2012 04:39 AM
can I run a macro when I open a specific doc. shreked Word 8 01-12-2012 03:36 AM


All times are GMT -7. The time now is 02:40 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft