Hello All,
I want to make a word document using VBA.
I have created a new document and placed a Command Button on it. If the user clicks on the button an user forms opens and shows the available option that can be added in the document.
The User form was no problem, I can also filter the selected options, but currently I'm having problems with hiding the initial button.
I have tried the following code:
I checked it using:
But both counts returned 0...
If I use this code in Excel it works fine...
I also do not know how to add text to the document using VBA, can somebody tell me that as well??
Thx.
Marc D.
No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.
I want to make a word document using VBA.
I have created a new document and placed a Command Button on it. If the user clicks on the button an user forms opens and shows the available option that can be added in the document.
The User form was no problem, I can also filter the selected options, but currently I'm having problems with hiding the initial button.
I have tried the following code:
Code:
If ActiveDocument.Shapes("CommandButton2").Visible = True Then
ActiveDocument.Shapes("CommandButton2").Visible = False
End If
I checked it using:
Code:
MsgBox ActiveDocument.Shapes.Count
MsgBox ThisDocument.Shapes.Count
But both counts returned 0...
If I use this code in Excel it works fine...
I also do not know how to add text to the document using VBA, can somebody tell me that as well??
Thx.
Marc D.
No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.