View Full Version : سوال: ارسال فکس در اکسس
jamalm
سه شنبه 21 خرداد 1387, 23:49 عصر
سلام,لطفا در مورد ارسال فکس با اکسس کمک کنید.به عنوان مثال بانک اطلاعاتی که اعدادی شماره داره می خوایم یک ریپورت رو برای یک یا چند نفر فکس کنیم.
amirzazadeh
چهارشنبه 22 خرداد 1387, 08:06 صبح
دوست عزيز براي اينكار در ابتدا گزارش رو در نماي طراحي باز كن بعد از منوي file>page setup به تب page برو و نوع پرينتر رو ابتدا از نوع پرينتر هاي ويژه و سپس در داخل آن microsoft fax انتخاب كن.
بعد در رويداد on open گزارش اين كد رو وارد كن:
Me.Filter = strInvoiceWhereونهايتا توي يك ماژول اين كد رو وارد كن
Option Explicit
Public strInvoiceWhere As String
'************************************************* ***************
'This function will walk through the Customers table and fax the
'Invoice report that is filtered by the CustomerID field by using
'MS Fax through the MS Access SendObject.
'
'This function assumes that the Invoice report has the default printer
'set to MS Fax, and that the MS Fax driver is installed correctly.
'************************************************* ***************
Function FaxInvoices()
Dim dbsNorthwind As DAO.Database
Dim rstCustomers As DAO.Recordset
Set dbsNorthwind = CurrentDb()
Set rstCustomers = dbsNorthwind.OpenRecordset("Customers", _
dbOpenDynaset)
If MsgBox("Do you want to fax invoices" & Chr(13) & _
"to all customers who are using Microsoft Fax?", 4) = 6 Then
With rstCustomers
Do Until .EOF
'Create the Invoice report Filter
'that is used by the Report_Open event.
strInvoiceWhere = "[CustomerID] = '" & ![CustomerID] & "'"
DoCmd.SendObject acReport, "Invoice", acFormatRTF, _
"[fax: " & ![Fax] & "]", , , , , False
.MoveNext
Loop
End With
End If
rstCustomers.Close
End Function
در اين كد ريپورت invoice از ديتا بيس northwind انتخاب شده است.اگر پرينتر فاكس در ليست پرينترهات ديده نميشه سرويس فاكس ويندوزت رو فعال كن.
اگر خواستين با ماكرو اين كارو انجام بدين از كد زير استفاده كن
Macro name Action
------------------------
SendFax SendObject
Action Arguments
----------------------------------------------------------------
Object type: Report
Object name: Catalog
Output format: Rich Text Format
To: [Fax: +98 (###) ###-####] (where (###) ###-#### is the fax number)
.....................................
موفق باشيد
laia56
جمعه 22 آذر 1387, 12:17 عصر
دوست عزیز با تشکر
لطفا مراحل بعدی ارسال فکس را توضییح بدهید با فرض اینکه برنامه بتواند خودش شماره های فکس را از جدول مشخص شده در کد بالا بخواند و ارسال کند چه کدی باید نوشت لطفا کمک کنید نیاز فوری دارم
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.