C
Colonel Blip
FYI to folks here. Been carrying this thread on microsoft.public.publisher
but more logically belongs here.
Hello, Ed!
You wrote on Thu, 14 Oct 2004 17:41:29 +0100:
EB> You will need to use different names for your button object each time
EB> (such as cbbMyButton2, cbbChangeStuffToDifferentDimensions, cbbFooBar,
EB> etc.)
Back again. Tried adding code as indicated below (changed all cbbMyButton
entries to cbbMyButton1) however I got a compile error.
I changed the Dim back to cbbMyButton only but that didn't solve the
problem. Also deleted the Dim statement altogether since I figured I only
needed one Dim. I also tried the "Private Sub cbbMyButton1_Click(ByVal Ctrl
As Office.CommandBarButton, CancelDefault As Boolean)" as "Private Sub
cbbMyButton_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As
Boolean)" but that didn't help.
Guess I am not interpreting the change correctly.
Thanks,
Colonel Blip.
E-mail: (e-mail address removed)
Dim WithEvents cbbMyButton1 As Office.CommandBarButton
Private Sub cbbMyButton1_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
With ThisDocument.Selection
If Not .ShapeRange.Count = 1 Then
Beep
Else
With .ShapeRange(1)
If .Width >= .Height Then
.Width = 432
.Height = 288
Else
.Width = 288
.Height = 432
End If
End With
End If
End With
End Sub
Private Sub Document_BeforeClose(Cancel As Boolean)
On Error Resume Next
CommandBars(3).Controls("Resize selection to 6"" by 4""").Delete
End Sub
Private Sub Document_Open()
On Error Resume Next
Set cbbMyButton1 = CommandBars(3).Controls.Add(, , , , True)
cbbMyButton1.FaceId = 181
cbbMyButton1.Caption = "Resize selection to 6"" by 4"""
End Sub
but more logically belongs here.
Hello, Ed!
You wrote on Thu, 14 Oct 2004 17:41:29 +0100:
EB> You will need to use different names for your button object each time
EB> (such as cbbMyButton2, cbbChangeStuffToDifferentDimensions, cbbFooBar,
EB> etc.)
Back again. Tried adding code as indicated below (changed all cbbMyButton
entries to cbbMyButton1) however I got a compile error.
I changed the Dim back to cbbMyButton only but that didn't solve the
problem. Also deleted the Dim statement altogether since I figured I only
needed one Dim. I also tried the "Private Sub cbbMyButton1_Click(ByVal Ctrl
As Office.CommandBarButton, CancelDefault As Boolean)" as "Private Sub
cbbMyButton_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As
Boolean)" but that didn't help.
Guess I am not interpreting the change correctly.
Thanks,
Colonel Blip.
E-mail: (e-mail address removed)
Dim WithEvents cbbMyButton1 As Office.CommandBarButton
Private Sub cbbMyButton1_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
With ThisDocument.Selection
If Not .ShapeRange.Count = 1 Then
Beep
Else
With .ShapeRange(1)
If .Width >= .Height Then
.Width = 432
.Height = 288
Else
.Width = 288
.Height = 432
End If
End With
End If
End With
End Sub
Private Sub Document_BeforeClose(Cancel As Boolean)
On Error Resume Next
CommandBars(3).Controls("Resize selection to 6"" by 4""").Delete
End Sub
Private Sub Document_Open()
On Error Resume Next
Set cbbMyButton1 = CommandBars(3).Controls.Add(, , , , True)
cbbMyButton1.FaceId = 181
cbbMyButton1.Caption = "Resize selection to 6"" by 4"""
End Sub