dat als je de volgende keer dat bestand opent er een kadertje komt
met een tekst dat je zelf kunt schrijven. Hoe moet ik dat dan doen??
Ps: Ik heb het vroeger nog gekund maar ik weet niet meer hoe.
![Twisted Evil :twisted:](./images/smilies/icon_twisted.gif)
Code: Selecteer alles
Private Sub Workbook_Open()
MsgBox "Sup Biach?", vbQuestion + vbOKOnly, "Bling-bling"
End Sub
Squirtle schreef:Code: Selecteer alles
Private Sub Workbook_Open()
MsgBox "Sup Biach?", vbQuestion + vbOKOnly, "Bling-bling"
End Sub
Code: Selecteer alles
Sub autoopen()
'remove possible gui modifs remaining from previous session
CleanUpIncidentInterface
'create the incident management button
createNewIncidentToolBar
'add an item in the EDIT menu bar
AddIncidentManagementMenuItem
'make a short-key for the button
createCustomShortCutKey
'prepare jet
Initialize
frmIncidentManagment.ClearFields
'fill in comboboxes
getRequestors
'getInitialRequestors
getBuxes
getBuxNumbers
getFunctions
getProjects
getPriorities
blnHasBeenFilled = False
blnHasBeenClosed = False
End Sub
Sub createNewIncidentToolBar()
Dim cbrCommandBar As CommandBar
Dim cbcCommandBarButton As CommandBarButton
' If the command bar exits, remove it.
On Error Resume Next
Application.CommandBars("IncidentManagement").Delete
' Add the command bar to the application's CommandBars collection.
Set cbrCommandBar = Application.CommandBars.Add
cbrCommandBar.Name = "IncidentManagement"
' Add command button control to the control's
' collection of CommandBar objects.
With cbrCommandBar.Controls
Set cbcCommandBarButton = .Add(msoControlButton)
' Set properties of the command button.
With cbcCommandBarButton
.Style = msoButtonIconAndCaption
.Caption = "Capture Incident"
.FaceId = 231
.TooltipText = "Capture the selected text as a new Incident."
.OnAction = "DisplayIncidentForm"
.Tag = "Capture Incident"
End With
End With
cbrCommandBar.Visible = True
End Sub
Sub AddIncidentManagementMenuItem()
Dim cbmMenuBar As CommandBarPopup
Dim cbcMenuItem As CommandBarButton
Dim strMenuBarName As String
' Remove menu item if it exists.
On Error Resume Next
Application.CommandBars("Menu Bar").Controls("Edit").Controls("Capture Incident").Delete False
' Identify menu bar that will receive new item.
strMenuBarName = "Menu Bar"
Set cbmMenuBar = Application.CommandBars(strMenuBarName).Controls("Edit")
' Add menu item.
Set cbcMenuItem = cbmMenuBar.Controls.Add(Type:=msoControlButton, Before:=8)
' Set property values of menu item.
With cbcMenuItem
.Caption = "Capture Incident"
.OnAction = "DisplayIncidentForm"
.Tag = "Capture Incident"
.ShortcutText = "Ctrl+I"
.FaceId = 231
End With
End Sub
Sub createCustomShortCutKey()
'link CTRL-I to Incident Management button
CustomizationContext = ActiveDocument
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyI, wdKeyControl), KeyCategory:=wdKeyCategoryMacro, Command:="DisplayIncidentForm"
End Sub
Sub DisplayIncidentForm()
If Not blnHasBeenFilled Then
'after clear or first time
blnHasBeenFilled = True
frmIncidentManagment.ClearFields
fillIncidentForm
frmIncidentManagment.Show
Else
If blnHasBeenClosed Then
blnHasBeenClosed = False
If Selection.Characters.Count >= 1 Then
frmIncidentManagment.txtIncidentDesc = Selection.Text
frmIncidentManagment.txtSolutionPropo = Empty
End If
Else
'after hide
frmIncidentManagment.Show
End If
End If
End Sub
Sub CleanUpIncidentInterface()
Dim varItem As Variant
'remove EDIT menu item
For Each varItem In Application.CommandBars("Menu Bar").Controls("Edit").Controls
If varItem.Caption = "Capture Incident" Then
varItem.Delete False
End If
Next varItem
'remove Incident Management Cmd Bar
For Each varItem In Application.CommandBars()
If varItem.Name = "IncidentManagement" Then
varItem.Delete
End If
Next varItem
'remove Ctrl-I from form
CustomizationContext = ActiveDocument
FindKey(BuildKeyCode(wdKeyI, wdKeyControl)).Disable
End Sub
Code: Selecteer alles
Private Sub worksheet_activate()
MsgBox "Yo!"
End Sub