Selasa, 14 Mei 2013

RE: [MS_AccessPros] Re: Print button to print attachment - Acc2007

 

One way is to save the Attachment as a file, then open and print it using
its "native" program. Here's Help on how to save an attachment:

Field2.SaveToFile Method

Saves an attachment to disk. .
Version Information
Version Added: Access 2007

Syntax:

expression.SaveToFile(FileName)

expression A variable that represents a Field2 object.

Parameters:

Name Required/Optional Data Type Description

FileName Required String The fully qualified path of the file to
which you want to save the attachment.

Example:

The following code snippet illustrates how to use the SaveToFile method to
save all of the attachments for a specific employee to disk.

Visual Basic for Applications

' Instantiate the parent recordset.
Set rsEmployees = db.OpenRecordset("Employees")

. Code to move to desired employee

' Instantiate the child recordset.
Set rsPictures = rsEmployees.Fields("Pictures").Value

' Loop through the attachments.
While Not rsPictures.EOF

' Save current attachment to disk in the "My Documents" folder.
rsPictures.Fields("FileData").SaveToFile _
"C:\Documents and Settings\Username\My Documents"
rsPictures.MoveNext
Wend

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Bill Mosca
Sent: Monday, May 13, 2013 3:37 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Print button to print attachment - Acc2007

I'm not sure how to do that. What kind of file is it?

Regards,
Bill Mosca, Founder - MS_Access_Professionals http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-6427073088
1E
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com

--- In MS_Access_Professionals@yahoogroups.com, "moi" <zjubias@...> wrote:
>
> Hello all,
>
> Is it possible to create a print button to print the attachment file. Path
and file name is save in a control/field in my form..
>
> If so, can someone please show me..
>
> Thanks in advance..
>
> zjubias
>

------------------------------------

Yahoo! Groups Links

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar