Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VBA: Outlook und UNC Pfad ermitteln

Empfohlene Antworten

Veröffentlicht

HI,

ich hab ein kleines Problem. Ich möchte in Outlook ein Makro erstellen, das folgendermaßen aufgebaut ist...

Anstatt das die Anlage mit an die Email angehängt wird, soll der Dateipfad genommen werden und als UNC Pfad aufgelöst werden... Sprich aus der Datei Y:\test\datei.xls soll werden \\filsrv1\ordner\test\datei.xls

Wie kann ich das realisieren? Einen VBA Code für das Auflösen des Netzlaufwerkes hab ich bereits...

 

Declare Function WNetGetConnection32 Lib "MPR.DLL" Alias _

"WNetGetConnectionA" (ByVal lpszLocalName As String, ByVal _

lpszRemoteName As String, lSize As Long) As Long


Dim lpszRemoteName As String

Dim lSize As Long


Const NO_ERROR As Long = 0


Const lBUFFER_SIZE As Long = 255


Sub Test()


DriveLetter = UCase(InputBox("Tragen Sie hier den Buchstaben ihres Laufwerkes ein" & _

"Connection." & Chr(10) & "z.B. Z (Ohne Doppelpunkt eingeben)"))


DriveLetter = DriveLetter & ":"


cbRemoteName = lBUFFER_SIZE


lpszRemoteName = lpszRemoteName & Space(lBUFFER_SIZE)


lStatus& = WNetGetConnection32(DriveLetter, lpszRemoteName, _

cbRemoteName)


If lStatus& = NO_ERROR Then


MsgBox lpszRemoteName, vbInformation


Else


MsgBox "Unable to obtain the UNC path.", vbInformation


End If


End Sub

Dieser Code funktioniert auch... SPrich ich bekomme eine InputBox wo ich meinen Laufwerksbuchstaben eintrage und dann eine msgbox, in der ich den Buchstaben als UNC Pfad aufgelöst bekomme... Nur wie kann ich es so realisieren, das ich beim Aufruf dieses Makros den Datei öffnen Dialog erhalte (bzw. den Dialog wo ich normalerweise meinen Anhang auswähle) und die Ausgewählte Datei als UNC-Pfad in die Mail mit eingefügt wird?

Schon mal vielen Dank im Voraus...

so long

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.