Ed, thank you very much for your help. Unfortunately I didn't have a chance
to work on it till now.
I found all my shapes numbers by using in immediate window
ActiveDocument.Pages(11).Shapes(y).Select entering different numbers instead
of y.
To use the code you advised before to block the empty form sending I need to
recognize the event when a user click the Submit button to interapt the
submition. There are no any properties for the Submit button such as click
event.
I would appreciate if you could advise how it's possible to do this.
Thanks
Alex <Alex@discussions.microsoft.com> was very recently heard to utter:
> To use the code you advised before to block the empty form sending I
> need to recognize the event when a user click the Submit button to
> interapt the submition. There are no any properties for the Submit
> button such as click event.
> I would appreciate if you could advise how it's possible to do this.
You will need to create a CommandBarButton and use that as your submit
button.
I believe there is a tutorial on this at www.publishermvps.com. If not,
post back and I'll dig it out.
There are no events associated with individual shapes at all. You cannot
access the web events of web controls within a document.

Signature
Ed Bennett - MVP Microsoft Publisher
Alex - 30 Oct 2005 22:59 GMT
Thanks again, Ed.
I couldn't find anything associated with this on the Publisher website.
But, i found your code that can relate to this:
"Here's some code I posted almost exactly two years ago to this group:
===
Public WithEvents cbbButton As Office.CommandBarButton
Sub Dummy()
MsgBox "Dummy"
End Sub
Private Sub cbbButton_Click(ByVal Ctrl As Office.CommandBarButton, _
CancelDefault As Boolean)
Dummy
End Sub
Private Sub Document_BeforeClose(Cancel As Boolean)
cbbButton.Delete
End Sub
Private Sub Document_Open()
Dim cbBar As Office.CommandBar
On Error Resume Next
Set cbBar = Publisher.CommandBars("Macros")
If Err.Number = 0 Then
'everything is fine
Else
Set cbBar = Publisher.CommandBars.Add("Macros")
Err.Clear
End If
Set cbbButton = cbBar.Controls(msoControlButton)
If Err.Number = 0 Then
'everything is fine
Else
Set cbbButton = cbBar.Controls.Add(msoControlButton)
End If
Err.Clear
'you can insert some code to format the button here
End Sub
==="
But, now I have a well working form with the Submit button. Will it be
possible to give the CommandBarButton the same functionalities as the
existing Submit button?
Thanks
> Alex <Alex@discussions.microsoft.com> was very recently heard to utter:
> > To use the code you advised before to block the empty form sending I
[quoted text clipped - 11 lines]
> There are no events associated with individual shapes at all. You cannot
> access the web events of web controls within a document.
Ed Bennett - 30 Oct 2005 23:01 GMT
Alex <Alex@discussions.microsoft.com> was very recently heard to utter:
> But, now I have a well working form with the Submit button. Will it be
> possible to give the CommandBarButton the same functionalities as the
> existing Submit button?
Tell me Alex, are you trying to create a web form with this submit button?

Signature
Ed Bennett - MVP Microsoft Publisher
Alex - 30 Oct 2005 23:15 GMT
I've already created web site with the form with the text boxes/areas and
Submit button and published it. The submit form is working well. I'm just
thinking how to block the empty form submition.
Thanks
> Alex <Alex@discussions.microsoft.com> was very recently heard to utter:
> > But, now I have a well working form with the Submit button. Will it be
> > possible to give the CommandBarButton the same functionalities as the
> > existing Submit button?
>
> Tell me Alex, are you trying to create a web form with this submit button?
Ed Bennett - 30 Oct 2005 23:28 GMT
Alex <Alex@discussions.microsoft.com> was very recently heard to utter:
> I've already created web site with the form with the text boxes/areas
> and Submit button and published it. The submit form is working well.
> I'm just thinking how to block the empty form submition.
I tried to explain before, but I think there was a bit of a
misunderstanding.
You CANNOT use VBA code on a web page. VBA code only works in the Publisher
environment.
For validation purposes you must use JavaScript or similar, which must be
manually added to the Publisher-generated HTML file. Alternatively, you
could have the form redirect to a server-side script that validates.
Either way, the best place to ask your question is the .webdesign newsgroup.
Apologies for any inconvenience I've caused.

Signature
Ed Bennett - MVP Microsoft Publisher
Alex - 30 Oct 2005 23:46 GMT
Thank you very much, Ed. You bet .... Now, I've got it.
> Alex <Alex@discussions.microsoft.com> was very recently heard to utter:
> > I've already created web site with the form with the text boxes/areas
[quoted text clipped - 14 lines]
>
> Apologies for any inconvenience I've caused.