Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-07-2018, 11:11 PM
gmayor's Avatar
gmayor gmayor is offline Word VBA - Ignore MsgBox Windows 10 Word VBA - Ignore MsgBox Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
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 ofgmayor has much to be proud of
Default

Move the message box to where you need to ask the question e.g.


Code:
Sub DeleteButton()
Dim obj As Object
Dim varResponse As Variant

    For Each obj In ActiveDocument.InlineShapes
        If obj.OLEFormat.Object.Name = "CommandButton1" Then
            varResponse = MsgBox("Button will be deleted.")
            If varResponse = vbOK Then obj.Delete
        End If
    Next
End Sub
__________________
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word VBA - Ignore MsgBox Problem with Msgbox in VBA Puzzled Programmer Excel Programming 6 09-06-2018 04:34 PM
msgbox when deleting cells Mikedk64 Excel Programming 11 07-13-2017 07:14 AM
What happend to Ignore once (spell check) in Word 2013? nick93 Word 2 07-05-2016 01:44 PM
How to make word ignore a specific shape when printing? ZAK Word 12 04-07-2014 03:14 PM
Word VBA - Ignore MsgBox Make MsgBox appear... Jamtart PowerPoint 3 09-01-2012 08:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:27 AM.


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