تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
لارسال فاكس باستخدام MS Word من خلال SQL
#1
كاتب الموضوع : AhmedEssawy


كود :
/*Sql Server OLE Automation example by Giuseppe Dimauro 04/2000. Many Many Thanx to Him and all other developers....*/
DECLARE @WordDocument int
DECLARE @WordApplication int
DECLARE @Content int
DECLARE @visible int
DECLARE @hr int
DECLARE @text varchar(4096)
-- Set WordDocument = CreateObject("Word.Document")
EXEC @hr = sp_OACreate 'word.Document', @WordDocument OUT
-- Set Application = WordDocument.Application
IF @hr = 0
EXEC @hr = sp_OAGetProperty @WordDocument, 'Application', @WordApplication OUT
-- Set Content = WordDocument.Content
IF @hr = 0
EXEC @hr = sp_OAGetProperty @WordDocument, 'Content', @Content OUT
-- Content.Text = "Word Document " + vbNewLine + "generated by SQL Server"
IF @hr = 0

BEGIN
set @text = 'Word Document' + char(10) + 'generated by SQL Server'
EXEC @hr = sp_OASetProperty @Content, 'Text', @text
END
-- WordApplication.Visible = True
IF @hr = 0

BEGIN
EXEC @hr = sp_OASetProperty @WordApplication, 'Visible', 1
waitfor delay '00:00:10'
END
-- WordDocument.SendFax "", "Send a fax from SQL Server"
IF @hr = 0
EXEC @hr = sp_OAMethod @WordDocument, 'SendFax', NULL, '', 'Invio fax da SQL Server'
IF @hr <> 0

BEGIN
print "ERROR OCCURRED: " + cast(@hr as varchar(128))
RETURN
END
}}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  عمل جدول للتاريخ والوقت باستخدام intervals RaggiTech 0 2,135 17-10-12, 02:08 PM
آخر رد: RaggiTech

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم