แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Note Ekkachai

หน้า: [1]
1
ผมใช้Office2016และเก็บรูปภาพเป็นพาธไฟล์เมื่อเปิดฟอร์มรูปภาพจะไม่โชว์ ต้องแก้ไขอย่างไรให้เปิดฟอร์มแล้วมีภาพทันทีครับ

2
ในโฟลเดอร์Pictureจะมีรูปเยอะอยู่แล้ว ติดตรงที่กล้องที่ถ่ายจะบันทึกชื่อไฟล์ซ้ำกับรูปที่เคยมี

ผมเลยกำหนดให้กล้องสร้างโฟลเดอร์ขึ้นมาไว้ในโฟลเดอร์Picture โดยจะตั้งอัตโนมัติเป็นปีเดือนวัน เช่น 2018-8-18

ผมจะแก้ยังไงดีครับ โดยโค้ดที่ใช้อยู่ในปัจจุบันคือ

Option Compare Database
Option Explicit

Public Function iFileDialog() As String
 Const msoFileDialogFilePicker = 3
 Const msoFileDialogViewDetails = 2
 Dim fd As Object, varltems As Variant, flPath As Variant
 Set fd = Application.FileDialog(msoFileDialogFilePicker)
 With fd
    .Title = "Choose"
    .InitialView = msoFileDialogViewDetails
    .Filters.Clear
    .Filters.Add "Image", "*.jpg;*.png;*.bmp"
    .Filters.Add "All Files", "*.*"
    .filterIndex = 1
    .InitialfileName = CurrentProject.Path & "\Picture"
    If fd.show = True Then
        iFileDialog = Trim(.SelectedItems.Item(1))
    End If
  End With
End Function

ขอบคุณครับ

หน้า: [1]