سنتر العرب
 

ماشاء الله تبارك الله ماشاء الله لاقوة الا بالله , اللهم اني اسالك الهدى والتقى والعفاف والغنى

   

 

 

    تويتر فيس بوك

 

Loading


العودة   منتديات سنتر العرب > سنتر العرب - الاقسام العامة > سنتر العرب - الأنترنت والكمبيوتر و الـ DSL > سنتر العرب لخدمات الويب > لغات البرمجه, php , asp,Ajax, visual basic Java

لغات البرمجه, php , asp,Ajax, visual basic Java لغات البرمجه, php , asp,Ajax, visual basic Java,لغات البرمجه, php , asp,Ajax, visual basic Java,لغات البرمجه, php , asp,Ajax, visual basic Java,لغات البرمجه, php , asp,Ajax, visual basic Java,


كود تحويل من HTM إلى Word

لغات البرمجه, php , asp,Ajax, visual basic Java


إضافة رد
 
أدوات الموضوع
قديم 07-12-2010, 12:42 PM   رقم المشاركة : [1]
عنـ الشوق ـاد
,

 الصورة الرمزية عنـ الشوق ـاد
 





عنـ الشوق ـاد is a splendid one to behold عنـ الشوق ـاد is a splendid one to behold عنـ الشوق ـاد is a splendid one to behold عنـ الشوق ـاد is a splendid one to behold عنـ الشوق ـاد is a splendid one to behold عنـ الشوق ـاد is a splendid one to behold عنـ الشوق ـاد is a splendid one to behold عنـ الشوق ـاد is a splendid one to behold

 
افتراضي كود تحويل من HTM إلى Word

كود تحويل من HTM إلى Word


اقتباس:

Private Sub Cleanup()
Set IE =
Nothing
Set Word
=
Nothing
Set Response
=
Nothing
Set Session
=
Nothing
Set Server
=
Nothing
Set ASP
=
Nothing
Set Stream
=
Nothing
End Sub


Public Sub Download(ByRef pstrURL As Variant
)
Dim lstrPath As
String
Dim lstrFileName
As
String
Dim ldblStart
As
Double
mblnDone
=
False
ldblStart
=
Timer
Call IE
.Navigate2(pstrURL
)


While
IE.Busy And
Not mblnDone


DoEvents


If (Timer - ldblStart) > Server.
ScriptTimeout Then
Call Cleanup
Err
.Raise vbObjectError + 1, "HTML2Word.dll",
"Connect Timeout - Busy"
End
If
Wend


While Not (IE.Document.ReadyState = "complete" Or mblnDone
)


DoEvents


If (Timer - ldblStart) > Server.
ScriptTimeout Then
Call Cleanup
Err
.Raise vbObjectError + 2, "HTML2Word.dll",
"Connect Timeout - Not Complete"
End
If
Wend
Call IE
.Document.Body.createTextRange.execCommand("Copy"
)


DoEvents
lstrFileName
= Session.SessionID &
".doc"
lstrPath = App.Path & "\~" & Hex(Timer) & "_" &
lstrFileName


DoEvents
On Error Resume Next
Word
.Content.
Paste


If
Err Then
Call Cleanup
Dim lstrMsg
lstrMsg
= Err.
Description
On Error Goto 0
Err
.Raise vbObjectError + 3, "HTML2Word.dll", "Can Not paste - " &
lstrMsg
End
If
On Error Goto 0
Word
.
SaveAs lstrPath
Word
.
Close
Response
.ContentType =
"application/octet-stream"
Response.AddHeader "content-disposition", "attatchment; filename=" &
lstrFileName
Stream
.
Open
Stream
.
LoadFromFile lstrPath
Response
.BinaryWrite Stream.
ReadText
Stream
.
Close
Response
.
Flush
Response
.
End
FileSystem
.
Kill lstrPath
End Sub


Public Sub OnEndPage
()
Call Cleanup
End Sub


Private Sub IE_StatusTextChange(ByVal Text As String
)
If
Text = "Done" Then mblnDone =
True


DoEvents
End Sub

Private ASP As ASPTypeLibrary.
ScriptingContext
Private Response As ASPTypeLibrary.
Response
Private Session As ASPTypeLibrary.
Session
Private Server As ASPTypeLibrary.
Server
Private WithEvents IE As SHDocVw.
InternetExplorer
Private Word As Word.
Document
Private Stream As ADODB.
Stream
Private
mblnDone


Public Sub OnStartPage(ByRef ASPLink As ASPTypeLibrary.ScriptingContext
)
Set ASP =
ASPLink
Set Response
= ASPLink.
Response
Set Session
= ASPLink.
Session
Set Server
= ASPLink.
Server
Set IE
= New SHDocVw.
InternetExplorer
Set Word
= New Word.
Document
Set Stream
= New ADODB.
Stream
Response
.
Clear
End Sub


Private Sub Cleanup
()
Set IE =
Nothing
Set Word
=
Nothing
Set Response
=
Nothing
Set Session
=
Nothing
Set Server
=
Nothing
Set ASP
=
Nothing
Set Stream
=
Nothing
End Sub


Public Sub Download(ByRef pstrURL As Variant
)
Dim lstrPath As
String
Dim lstrFileName
As
String
Dim ldblStart
As
Double
mblnDone
=
False
ldblStart
=
Timer
Call IE
.Navigate2(pstrURL
)


While
IE.Busy And
Not mblnDone


DoEvents


If (Timer - ldblStart) > Server.
ScriptTimeout Then
Call Cleanup
Err
.Raise vbObjectError + 1, "HTML2Word.dll",
"Connect Timeout - Busy"
End
If
Wend


While Not (IE.Document.ReadyState = "complete" Or mblnDone
)


DoEvents


If (Timer - ldblStart) > Server.
ScriptTimeout Then
Call Cleanup
Err
.Raise vbObjectError + 2, "HTML2Word.dll",
"Connect Timeout - Not Complete"
End
If
Wend
Call IE
.Document.Body.createTextRange.execCommand("Copy"
)


DoEvents
lstrFileName
= Session.SessionID &
".doc"
lstrPath = App.Path & "\~" & Hex(Timer) & "_" &
lstrFileName


DoEvents
On Error Resume Next
Word
.Content.
Paste


If
Err Then
Call Cleanup
Dim lstrMsg
lstrMsg
= Err.
Description
On Error Goto 0
Err
.Raise vbObjectError + 3, "HTML2Word.dll", "Can Not paste - " &
lstrMsg
End
If
On Error Goto 0
Word
.
SaveAs lstrPath
Word
.
Close
Response
.ContentType =
"application/octet-stream"
Response.AddHeader "content-disposition", "attatchment; filename=" &
lstrFileName
Stream
.
Open
Stream
.
LoadFromFile lstrPath
Response
.BinaryWrite Stream.
ReadText
Stream
.
Close
Response
.
Flush
Response
.
End
FileSystem
.
Kill lstrPath
End Sub


Public Sub OnEndPage
()
Call Cleanup
End Sub


Private Sub IE_StatusTextChange(ByVal Text As String
)
If
Text = "Done" Then mblnDone =
True


DoEvents
End Sub
[/right
]
[
right
]
[/
right][/right]

توقيع عنـ الشوق ـاد
عنـ الشوق ـاد غير متواجد حالياً   رد مع اقتباس
قديم 07-12-2010, 01:35 PM   رقم المشاركة : [2]
الـــدانـــة
ادارية
 




الـــدانـــة is a jewel in the rough الـــدانـــة is a jewel in the rough الـــدانـــة is a jewel in the rough الـــدانـــة is a jewel in the rough

 
افتراضي رد: كود تحويل من HTM إلى Word

اللــــه يعطيــــك العافيـــة أخــــوي عنـــاد
جهـــــــود تشكــــــــر عليهــــــا
دمت ودام عطائـــــك

توقيع الـــدانـــة
 

الـــدانـــة غير متواجد حالياً   رد مع اقتباس
إضافة رد

مواقع النشر (المفضلة)

الكلمات الدلالية (Tags)
كود تحويل من htm إلى word


الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 
أدوات الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML متاحة

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

  Bookmark and Share

  


الساعة الآن 12:51 PM

|

www.swsws.net® Version 3.8.6
Copyright ©2000 - 2012, 7: swsws Ltd.
تنبية جميع ما يتم كتابته في المنتدى يعبر عن رأي كاتبه فقط ولا تتحمل إدارة منتديات سنتر العرب أدنى مسؤولية

Security team