Results 1 to 2 of 2

Thread: File Attachment

  1. #1
    Join Date
    Mar 2004

    Angry Unanswered: File Attachment

    Is there a way to choose a file (let's say a jpg) via a form and have it attach to the form and associated report?

    What I am looking to do is attach photographs to a report for e-mailing out via the macro sendobject command.

  2. #2
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    I suppose that could be done...

    I'm not sure the best way to do this, if it were me I would use a FileDialog to access and store the path, then dynamically assign the path name to your picture in the on_print section of the report.
    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Dim dlgFile As FileDialog
    Dim s As String
    Set dlgFile = Application.FileDialog(msoFileDialogOpen)
    With dlgFile
        If .Show = -1 Then
            For Each var In dlgFile.SelectedItems
                s = var
            Next var
        End If
    End With
    Set dlgFile = Nothing
    Me.yourImage.Picture = s
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts