Bilder in Userform per VBA aus Sharepoint Ordner anzeigen
FF3112
Hallo zusammen,
ich habe folgendes Problem:
In der Arbeit, wurde vor kurzem von einem lokalen Laufwerk auf Sharepoint umgestellt.
Jetzt passt mein untenstehender Code nicht mehr.
Mit diesem Code lasse ich Bilder aus einem Ordner in einer UserForm anzeigen und kann anschließend mittels Spin-Button zwischen den Bildern hin und her switchen.
Ich hoffe ihr könnt mir weiterhelfen?
Hier der Code:
Private Sub Image1_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub Image1_Click()
End Sub
Private Sub Label12_Click()
End Sub
Private Sub MultiPage1_Change()
End Sub
Private Sub SpinButton1_Change()
Image1.Picture = LoadPicture(arrFotos(SpinButton1))
Label1 = SpinButton1 + 1
TextBox1 = arrFotos(SpinButton1)
CheckBox1.Value = False
Repaint
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub UserForm_Activate()
Dim oFotos As Object, sFile As String
Set oFotos = CreateObject("Scripting.Dictionary")
Const Verz As String = "P:XX" (Hier muss ein Sharepointverzeichnis rein)
sFile = Dir(Verz & "*.jpg")
Do While sFile <> ""
oFotos(Verz & sFile) = 0
sFile = Dir
Loop
arrFotos = oFotos.keys
SpinButton1.Max = oFotos.Count - 1
TextBox1 = arrFotos(0)
Image1.Picture = LoadPicture(arrFotos(0))
Label1 = "1"
Label6 = oFotos.Count
TextBox5.Text = Format(Date, "dd.mm.yyyy")
TextBox6.Text = Format(Now, "hh:mm")
End Sub
'Suchfunktion, Bildnamen ändern und Image wird angezeigt
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Dir(TextBox1) <> "" Then
Image1.Picture = LoadPicture(TextBox1)
Repaint
End If
End Sub
Private Sub TextBox10_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim sFile As String
sFile = "P:XX"(Hier muss ein Sharepointverzeichnis rein)
If Dir(sFile & TextBox10 & ".jpg") <> "" Then
Image1.Picture = LoadPicture(sPath & TextBox10 & ".jpg")
TextBox1.Text = sPath & TextBox10.Text & ".jpg"
Repaint
End If
End Sub