![]() |
#1
|
|||
|
|||
![]()
Hi;
I am using MS Word 2016 and I am trying to ignore a MsgBox, if the button is already deleted. This Sub is being called in another Sub. How the code is now, the message will always show. Any help will be greatly appreciated. Code:
Sub DeleteButton() Dim obj As Object Dim varResponse As Variant varResponse = MsgBox("Button will be deleted.") For Each obj In ActiveDocument.InlineShapes If varResponse = vbOK Then If obj.OLEFormat.Object.Name = "CommandButton1" Then obj.Delete End If End If Next End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
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 |
![]() |
Jamtart | PowerPoint | 3 | 09-01-2012 08:21 AM |