Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-04-2018, 03:23 AM
guest_gast guest_gast is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Novice
Add a macro to a shape
 
Join Date: Oct 2017
Posts: 12
guest_gast is on a distinguished road
Default Add a macro to a shape

Hello,



I have add a attachment so you can beter understand my question.
I want to show userform1 when is press the big button.
Can someone explain to me how to do this?

Thanks
Attached Files
File Type: docm question.docm (18.4 KB, 8 views)
Reply With Quote
  #2  
Old 07-04-2018, 09:16 PM
gmayor's Avatar
gmayor gmayor is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Change the graphic to an activeX button - see attached.
Attached Files
File Type: docm question.docm (20.2 KB, 8 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 07-05-2018, 02:04 AM
guest_gast guest_gast is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Novice
Add a macro to a shape
 
Join Date: Oct 2017
Posts: 12
guest_gast is on a distinguished road
Default

Thanks for your reaction.
It is working but.....
I don't want to print the button
Do you know how to fix this?
Reply With Quote
  #4  
Old 07-05-2018, 04:31 AM
gmayor's Avatar
gmayor gmayor is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Put the button on a custom ribbon instead and there's no button to print.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 07-05-2018, 04:47 AM
guest_gast guest_gast is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Novice
Add a macro to a shape
 
Join Date: Oct 2017
Posts: 12
guest_gast is on a distinguished road
Default

Yes i know how to do that but than i got the problem that i can't share the ribbon with other persons. Do you have an idea how to fix this?

Thanks for your response!
Reply With Quote
  #6  
Old 07-05-2018, 08:48 PM
gmayor's Avatar
gmayor gmayor is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Of course you can. Add the ribbon to the document/template http://gregmaxey.mvps.org/word_tip_p...bbon_main.html
See attached
Attached Files
File Type: docm question.docm (21.7 KB, 10 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com

Last edited by gmayor; 07-06-2018 at 01:01 AM.
Reply With Quote
  #7  
Old 07-06-2018, 02:00 AM
guest_gast guest_gast is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Novice
Add a macro to a shape
 
Join Date: Oct 2017
Posts: 12
guest_gast is on a distinguished road
Default

Thanks!
I will read it.
Is this also working for word 2016
Reply With Quote
  #8  
Old 07-06-2018, 02:23 AM
gmayor's Avatar
gmayor gmayor is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

I assume you mean the link - in which case yes. It works for all ribbon equipped versions of Office.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #9  
Old 07-06-2018, 04:05 AM
guest_gast guest_gast is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Novice
Add a macro to a shape
 
Join Date: Oct 2017
Posts: 12
guest_gast is on a distinguished road
Default

Hi Graham,

Thanks for the link! It works perfect.
Only problem is that i get a error by this code: myRibbon.InvalidateControl control.id
Do you also have a code that i only see three buttons in the ribbon where i can link a macro to. See the attachment.

Thanks a lot!
Attached Images
File Type: jpg Knipsel.JPG (21.5 KB, 14 views)
Reply With Quote
  #10  
Old 07-06-2018, 04:45 AM
gmayor's Avatar
gmayor gmayor is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Did you see the attachment I posted originally, which demonstrates the code needed to operate a button. As you haven't attached your document, I cannot guess what your problem is.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #11  
Old 07-06-2018, 10:30 AM
guest_gast guest_gast is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Novice
Add a macro to a shape
 
Join Date: Oct 2017
Posts: 12
guest_gast is on a distinguished road
Default

Ahhaa
Sorry didn't see that one.
Last question (sorry....
Which code do i need to put in custom UI editor?

Thanks men
Reply With Quote
  #12  
Old 07-06-2018, 08:33 PM
gmayor's Avatar
gmayor gmayor is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

To edit the ribbon, open the document in the Custom UI editor, Open another copy of the editor and open your own document (with neither document open in Word). Copy the XML code from my document to yours - add buttons as required.


Save and close the UI editor then open the documents in Word and copy the macros across and edit as appropriate.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #13  
Old 07-07-2018, 02:20 AM
guest_gast guest_gast is offline Add a macro to a shape Windows 10 Add a macro to a shape Office 2016
Novice
Add a macro to a shape
 
Join Date: Oct 2017
Posts: 12
guest_gast is on a distinguished road
Default

Yessss finaly!
It works perfect!
Thanks a lot.
How do you know al this? I really like to do this work.
Do you have any tips for a online course to start?

Thanks
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change size / shape of a shape in a stencil tomgoodell Visio 1 06-30-2016 04:40 AM
Assign Macro to Shape in Word 2013 tunes10590 Word VBA 8 01-29-2015 06:26 AM
Add a macro to a shape locking shape within shape cpwljaw Drawing and Graphics 1 08-28-2012 12:13 AM
find the name of a shape Guy Roth Visio 0 05-23-2012 12:58 AM
Run Macro & Activate shape ibrahimaa Excel Programming 1 01-21-2012 02:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft