AW: Hyperlink mit drucken
19.12.2019 13:51:59
Nepumuk
Hallo Thorsten,
so ok?
Option Explicit
Private Declare PtrSafe Function ShellExecuteA Lib "shell32.dll" ( _
ByVal hwnd As LongPtr, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As LongPtr
Private Const SW_HIDE As Long = 0&
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim objHyperlink As Hyperlink
For Each objHyperlink In Worksheets("Tabelle1").Hyperlinks 'Tabellenname anpassen !!!
Call ShellExecuteA(Application.hwnd, "PRINT", _
objHyperlink.Address, vbNullString, vbNullString, SW_HIDE)
Next
End Sub
Gruß
Nepumuk