ต้องการเปิดหาfileภาพ
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 234   4
URL.หัวข้อ / URL
ต้องการเปิดหาfileภาพ

เรียนถามอาจารย์และท่านผู้รู้ทุกท่าน ดิฉันเคยเข้าไปโหลด file ในมุม download ของอาจารย์สุภาพ ชื่อ file showpic2 แต่ที่นี้ได้เอามาปรับปรุง ในส่วนตรงที่เวลาคลิ๊กปุ่มเปิดเลือกภาพค่ะ เพราะดิฉันได้ share driveเป็น \\Handdy\photo ไม่ทราบทำอย่างไรที่จะให้เวลาคลิ๊กปุ่มเลือกภาพ แล้วไปหาที่ path นี้เลยค่ะ

4 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R03161
เปลี่ยนจาก

ลองเปลี่ยนจาก

'Get Folder name
strFolderName = BrowseFolder("เลือกโฟล์เดอร์ที่เก็บรูปภาพ?")

ไปเป็น

'Get Folder name
strFolderName = "\\Handdy\photo"

ดูครับ
2 @R03163
อาจารย์ค่ะ แล้วที่อาจารย์แนะนำ ใช้กับปุ่ม Show Pics แล้วถ้าเป็นแบบใช้ปุ่ม Select Pic File ล่ะค่ะ จะกำหนดอย่างไรค่า
3 @R03164
ถ้าต้องการที่จำกำหนด Path ของห้องที่กำหนด
ต้องเข้าไปแก้ไขฟังก์ชัน GetOpenFile() ใน Module ชื่อ modOpenFile ดังนี้ครับ

Function GetOpenFile(strFileType As String, strFileTypeDesc As String) _
As Variant
Dim strFilter As String
Dim lngFlags As Long
Dim varFileName As Variant
' Specify that the chosen file must already exist,
' don't change directories when you're done
' Also, don't bother displaying
' the read-only box. It'll only confuse people.
lngFlags = ahtOFN_FILEMUSTEXIST Or _
ahtOFN_HIDEREADONLY Or ahtOFN_NOCHANGEDIR


' Define the filter string
strFilter = ahtAddFilterItem(strFilter, _
strFileTypeDesc, strFileType)
' Now actually call to get the file name.
varFileName = ahtCommonFileOpenSave( _
OpenFile:=True, _
Filter:=strFilter, _
Flags:=lngFlags, _
InitialDir:="\\Handdy\photo" , _
DialogTitle:="เลือกไฟล์รูปภาพที่ต้องการ ...")

If Not IsNull(varFileName) Then
varFileName = TrimNull(varFileName)
End If
GetOpenFile = varFileName
End Function *** Edited by Supap Chaiya *** 5/27/2003 10:37:06 PM
4 @R03196
ใช้ได้แล้วค่ะ ขอบคุณอาจารย์สุภาพมากค่ะ ขอให้อาจารย์มีสุขภาพแข็งแรงตลอดไป
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0586s