Skip to content

Instantly share code, notes, and snippets.

View rediffusion's full-sized avatar
🎯
Focusing

Mr. Nick rediffusion

🎯
Focusing
View GitHub Profile
$(document).ready(function( ){
// Тут уже можем обращаться к элементу...
$('#id')
});
// Более котортая запись...
$(function(){
// code...
});
Sub CallbackGetContent(control As IRibbonControl, ByRef XMLString)
Dim lngDummy As Long
Dim strDummy As String
Dim strContent As String
strDummy = "<menu xmlns=""http://schemas.microsoft"
strDummy = strDummy & ".com/office/2006/01/customui"">"
For lngDummy = 0 To 5
strContent = strContent & _
"<button id=""MyDynaButton" & lngDummy & _
""" label =""Dynamic Item" & _
@rediffusion
rediffusion / Office VBA_34
Last active July 30, 2019 13:09
NOTE: Для »» `Dynamic Menu` подходит тоже!
Option Explicit
Public bolVisible As Boolean
Sub CallbackGetVisible(control As IRibbonControl, ByRef visible)
visible = bolVisible
End Sub
Sub OnActionGallery(control As IRibbonControl, _
selectedId As String, _
selectedIndex As Integer)
Select Case control.ID
Case Else
Select Case selectedId
Case Else
MsgBox "The selected ItemID of Gallery-Control """ & control.ID & """ is : """ & selectedId & """" & vbCrLf & _
"Die selektierte ItemID des Gallery-Control """ & control.ID & """ ist : """ & selectedId & """", _
vbInformation
@rediffusion
rediffusion / Office VBA_32
Last active July 30, 2019 12:22
NOTE: Для »» “width” аналогично!
Sub CallbackGetItemHeight(control As IRibbonControl, ByRef height)
Select Case control.ID
Case "MyPictureGallery1"
' width
height = 50
End Select
End Sub
Sub CallbackDDGetSelectedItemID(control As IRibbonControl, ByRef itemID)
Select Case control.ID
Case "myDropDown"
itemID = "03a"
End Select
End Sub
@rediffusion
rediffusion / Office VBA_29
Last active July 30, 2019 12:27
NOTE: Для »» `Gallery` аналогично.
Sub CallbackDropDownOnAction(control As IRibbonControl, _
selectedId As String, _
selectedIndex As Integer)
Select Case control.ID
Case "myDropDown"
MsgBox "У вас " & DLookup("txtName", _
"tblPictures", "txtPicName = '" & _
Format(selectedIndex, "00") & "'") & _
" выбрано!", vbInformation, _
"Это заголовок!"
Sub MyComboBoxCallbackOnChange(control As IRibbonControl, strText As String)
Select Case control.ID
Case "myComboBox"
MsgBox "You have " & strText & " selected", _
vbInformation, _
"ComboBox Sample"
End Select
End Sub
@rediffusion
rediffusion / Office VBA_27
Last active July 30, 2019 12:22
NOTE: Для »» `DropDown ` аналогично!
Sub CallbackCBGetItemSupertip(control As IRibbonControl, _
index As Integer, _
ByRef supertip)
Select Case control.ID
Case "myComboBox"
supertip = Nz(DLookup("txtSubName", "tblPictures", _
"txtPicName='" & _
Format(index, "00") & "'"), " ")
End Select
End Sub
@rediffusion
rediffusion / Office VBA_26
Last active July 30, 2019 12:26
NOTE: Для »» `DropDown ` и `Gallery` аналогично!
Sub CallbackCBGetItemScreentip(control As IRibbonControl, _
index As Integer, _
ByRef screentip)
Select Case control.ID
Case "myComboBox"
screentip = DLookup("txtName", "tblPictures", _
"txtPicName='" & _
Format(index, "00") & "'")
End Select
End Sub