• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Userform üzerinden jpg dosyası yazdırma

Katılım
20 Aralık 2008
Mesajlar
73
Excel Vers. ve Dili
office 2003
türkçe
Arkadaşlar Merhaba,

Userform üzerinden belli bir klasördeki jpg uzantılı dosyayı veya dosyaları yazıcıdan çıktı alabilirmiyiz.

Şimdiden Teşekkür Ederim.
Sayğılarımla,
 
arkadaşlar 2 gün bekladim ama cevap yazan olmadı.
İlgilenebilirseniz çok sevinirim yoksa bu gidişle kafayı yiycem.
Sadece .jpg uzantılı dosyayı yazdırmak.
Sayğılarımla.
 
Kod:
 'Declare Variables...
   Dim MyPicFile As String
   Dim rpt As New Report
   Dim RptName As String
   
   'Fill the MyPicFile string variable with the name
   'of the image to print. Here we are simply using
   'the DLookUp Function to acquire the Path and Image
   'file name from Table. You can fill this variable
   'any way you like.
   MyPicFile = Nz(DLookup("[PicPath]", "[MyTable]", "[PicID]=" & Whatever), "")
   
   'Exit if it's found that the MyPicFile variable
   'contains nothing (empty string).
   If MyPicFile = "" Then Exit Sub
   
   'Trap Errors...
   On Error GoTo Error_PrintPic

   'Create the Temporary Report
   Set rpt = CreateReport()
   
   'Set Report Properties...
   With rpt
      '.Visible = False
      .PictureType = 1      'Linked
      .PictureSizeMode = 3  'Zoom
      .Picture = MyPicFile  'The Picture (image) to Print
      RptName = .Name
   End With
   
   'Print the report...
   DoCmd.OpenReport RptName, , , , acHidden

Exit_PrintPic:
   On Error Resume Next
   'Close the report
   DoCmd.Close acReport, RptName, acSaveNo
   'Delete the report
   DoCmd.DeleteObject acReport, RptName
   
   Set rpt = Nothing
   If Err <> 0 Then Err.Clear
   Exit Sub
   
Error_PrintPic:
   Dim ErrMsg As String
   'Message selectable Errors...
   Select Case Err.Number
     Case 2202
        ErrMsg = "There is no Printer attached to system." & vbCr & _
                 "Please attach Printer and try again."
     Case Else
        ErrMsg = Err.Number & " -- " & Err.Description
   End Select
   MsgBox ErrMsg, vbExclamation, "Picture Print Error"
   Resume Exit_PrintPic

internetten bu kodlari buldum yararli olurmu bilemiyorum.. denermisiniz..
 
Sayın Mustafaine ilginden dolayı çok teşekkür ederim.
verdiğin kodlarla uğraşıyorum ama birşey çıkartamadım.bir butona uyarladım çalışmadı.
Başka bir yolu varmı yokmu onu da bilmiyorum.Allah yardımcım olsun.
 
Ekli dosyayı inceleyin. Sanıyorum isteğinizi karşılayacaktır.
 

Ekli dosyalar

Levent Bey çok teşekkür ederim.Tam aradığım kod.
Allah sizden ve diğer excel uzmanlarından razı olsun.
İyi Çalışmalar.

Sayğılarımla,
 
Geri
Üst