Goedemiddag,
Word en Excel start ik met vba in een algemene module. Dat wil ik nu ook met Outlook, maar de applicatie wordt niet zichtbaar.
En de opdracht appOutlook.visible is, anders dan bij Word en Excel, niet toegestaan. Graag even hulp.
(Ik heb de On Error bij prcActivateOutlook even als tekst gemarkeerd)
Word en Excel start ik met vba in een algemene module. Dat wil ik nu ook met Outlook, maar de applicatie wordt niet zichtbaar.
En de opdracht appOutlook.visible is, anders dan bij Word en Excel, niet toegestaan. Graag even hulp.
(Ik heb de On Error bij prcActivateOutlook even als tekst gemarkeerd)
Code:
Sub prcActivateWord()
Public appWord As New Word.Application
On Error Resume Next
Set appWord = GetObject(, "Word.application")
If appWord = "" Then
Set appWord = CreateObject("Word.application")
End If
appWord.Visible = True
End Sub
Sub prcActivateExcel()
Public appExcel As New Excel.Application
On Error Resume Next
Set appExcel = GetObject(, "Excel.application")
If appExcel = "" Then
Set appExcel = CreateObject("Excel.application")
End If
appExcel.Visible = True
End Sub
Sub prcActivateOutlook()
Public appOutlook As New Outlook.Application
'On Error Resume Next
Set appOutlook = GetObject(, "Outlook.application")
If appOutlook = "" Then
Set appOutlook = CreateObject("Outlook.application")
End If
appOutlook.Visible = True
End Sub