Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Private Sub CommandButton1_Click()
' Zorg ervoor dat er vanuit VBA een verwijzing is naar de Microsoft Word object library
Dim wrdApp As Object
Dim wrdDoc As Object
Dim i As Integer
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add ' Maak een nieuw document
' of
'Set wrdDoc = wrdApp.Documents.Open("C:\docnaam.doc")
' Opent een bestaand document
' Regeltjes toevoegen
With wrdDoc
For i = 1 To 100
.Content.InsertAfter "Test regel nummer #" & i
.Content.InsertParagraphAfter
Next i
If Dir("C:\Newdoc.doc") <> "" Then
Kill "C:\Newdoc.doc"
End If
.SaveAs ("C:\Newdoc.doc")
.Close 'Sluit het document
End With
wrdApp.Quit ' close the Word application
Set wrdDoc = Nothing
Set wrdApp = Nothing
End Sub
Sub Infoblad()
Dim msg, style, title, response
msg = "Hallo beste Ledenadministrateur, nu kun je het blad ledeninformatie invullen! Wil je doorgaan?"
style = vbYesNo + vbDefaultButton2 + _
vbInformation
title = "Gegevens bijwerken?"
response = MsgBox(msg, style, title)
If response = vbYes Then
msg = "Of wil je toch maar eerst alle gegevens opslaan?"
style = vbYesNoCancel + vbDefaultButton1 + _
vbInformation
title = "Gaan we bijwerken, of eerst opslaan?"
response = MsgBox(msg, style, title)
If respons = vbNo Then
Dim wrdApp As Object
Dim wrdDoc As Object
Dim i As Integer
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add
End If
If response = vbYes Then
Application.Dialogs(xlDialogSaveAs).Show
If response = vbCancel Then
Range("B6").Select
End If
End If
End If
End Sub
Sub Infoblad()
Dim msg As String, title As String, response As Variant, response2 As Variant
Dim style As Variant
msg = "Hallo beste Ledenadministrateur, nu kun je het blad ledeninformatie invullen! " _
& "Wil je doorgaan?"
style = vbYesNo + vbDefaultButton2 + vbInformation
title = "Gegevens bijwerken?"
response = MsgBox(msg, style, title)
If response = vbYes Then
msg = "Of wil je toch maar eerst alle gegevens opslaan?"
style = vbYesNoCancel + vbDefaultButton1 + vbInformation
title = "Gaan we bijwerken, of eerst opslaan?"
response2 = MsgBox(msg, style, title)
If respons2 = vbNo Then
Dim wrdApp As Object
Dim wrdDoc As Object
Dim i As Integer
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add
ElseIf response2 = vbYes Then
Application.Dialogs(xlDialogSaveAs).Show
ElseIf response2 = vbCancel Then
Range("B6").Select
End If
End If
End Sub
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.