הדפסה מהירה של תמונה דרך אקסס
תוכנה
6
פוסטים
2
כותבים
180
צפיות
2
עוקבים
-
אני משתמש בקוד הזה לפתיחת תמונה מתוך המחשב
Dim Shex As Object Set Shex = CreateObject("Shell.Application") tgtfile = ImagePath Shex.Open (tgtfile)
כעת אני רוצה שהתמונה תודפס ללא פתיחה של התמונה.
ניסיתי כךDim Shex As Object Set Shex = CreateObject("Shell.Application") tgtfile = ImagePath Shex.Print (tgtfile)
אבל אני מקבל את השגיאה הזו
-
אני משתמש בקוד הזה לפתיחת תמונה מתוך המחשב
Dim Shex As Object Set Shex = CreateObject("Shell.Application") tgtfile = ImagePath Shex.Open (tgtfile)
כעת אני רוצה שהתמונה תודפס ללא פתיחה של התמונה.
ניסיתי כךDim Shex As Object Set Shex = CreateObject("Shell.Application") tgtfile = ImagePath Shex.Print (tgtfile)
אבל אני מקבל את השגיאה הזו
@אוריי תנסה כך:
Declare PtrSafe Function ShellExecute& Lib "shell32.dll" Alias "ShellExecuteA" (ByVal _ hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal _ lpParameters As String, ByVal lpDirectory As String, ByVal nshowcm As Long) Public Function PrintImage() ShellExecute(Application.hWndAccessApp, "Print", ImagePath, vbNullString, CurDir, 1) End Function
-
@אוריי תנסה כך:
Declare PtrSafe Function ShellExecute& Lib "shell32.dll" Alias "ShellExecuteA" (ByVal _ hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal _ lpParameters As String, ByVal lpDirectory As String, ByVal nshowcm As Long) Public Function PrintImage() ShellExecute(Application.hWndAccessApp, "Print", ImagePath, vbNullString, CurDir, 1) End Function
-
@אוריי זה קוד חדש.
את החלק העליון תכניס בראש המודול (לא בתוך פונקציה), ובפונקציה תכניס פרמטר של ImagePath עם הנתיב של התמונה. -
@ארי
זה לא עובד
חוצמזה אני לא מבין אם זה פונקציה ואני אמור לגשת אליה אני צריך לתת לה במשתנה את הנתיב וזה חסר בפונקציה שנתת
ואם אני אמור להכניס את השורה הזו בתוך המודול זה גם לא עובד