Command Button in Word Doc

D

dv

Hi


I have created a template that saves the filled in word form at a different
location. I am saving it as a word doc. I have embedded few command buttons
in the template. How do I delete these buttons when they are saving the
filled in forms.
I tried using vb script

For Each o In ActiveDocument.InlineShapes
MsgBox (o_OLEFormat.Object.Name)
If o_OLEFormat.Object.Name = "Clear" Then
o.Delete
End If
Next

it goes to o.Delete command but does not delete the button.
I checked the name as you can see with the Msgbox, it shows the name Clear.
It goes there but does nothing. It does not give any error too.
Am I missing something here?

This is the first time I am doing this so please reply as if to a rookie.

Any help is appreciated.

Thanks
 
R

RJL

Are you sure the name is "clear" and not the caption? I.e., have you tried
this?

OLEFormat.Object.Caption = "Clear"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top