<table width="100%" border="1" bgcolor="White" style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#C0CFE2', startColorstr='#FFFFFF', gradientType='0');"><tr><TD><font size="2" face=Courier New> <font color="#0000A0">Option</font> <font color="#0000A0">Explicit</font>
<font color="#0000A0">Private</font> <font color="#0000A0">Sub</font> CreateCustomBar()
<font color="#0000A0">Dim</font> cBar <font color="#0000A0">As</font> CommandBar
<font color="#0000A0">On</font> <font color="#0000A0">Error</font> <font color="#0000A0">Resume</font> <font color="#0000A0">Next</font>
Application.CommandBars("My Custom Bar").Delete
<font color="#0000A0">Set</font> cBar = Application.CommandBars.Add("My Custom Bar", , , True)
<font color="#008000"> 'this is a comment</font>
<font color="#0000A0">With</font> cBar.Controls
<font color="#0000A0">With</font> .Add(msoControlButton)
.Caption = "Button Three"
.Style = msoButtonCaption
<font color="#0000A0">End</font> <font color="#0000A0">With</font>
<font color="#0000A0">End</font> <font color="#0000A0">With</font>
<font color="#0000A0">End</font> <font color="#0000A0">Sub</font>
</FONT></td></tr></table><button onclick='document.all("527200863823627").value=document.all("527200863823627").value.replace(/<br \/>\s\s/g,"");document.all("527200863823627").value=document.all("527200863823627").value.replace(/<br \/>/g,"");window.clipboardData.setData("Text",document.all("527200863823627").value);'>Copy to Clipboard</BUTTON><textarea style="position:absolute;visibility:hidden" name="527200863823627" wrap="virtual">
Option Explicit
Private Sub CreateCustomBar()
Dim cBar As CommandBar
On Error Resume Next
Application.CommandBars("My Custom Bar").Delete
Set cBar = Application.CommandBars.Add("My Custom Bar", , , True)
'this is a comment
With cBar.Controls
With .Add(msoControlButton)
.Caption = "Button Three"
.Style = msoButtonCaption
End With
End With
End Sub</textarea>