can any one help me in changing the below VBA function to VBScript?
Public Function GetAttachment(ByVal FileName As String, ByRef oAttachment As Variant) As Long
Dim iFileNum As Integer
Dim abBytes() As Byte
Dim lFileLength As Long
On Error GoTo ErrorHandler
iFileNum = FreeFile
Open FileName For Binary Access Read As #iFileNum
lFileLength = LOF(iFileNum)
ReDim abBytes(lFileLength - 1)
Get #iFileNum, , abBytes()
oAttachment = abBytes()
GetAttachment = 0
GetAttachment = -1
If Err.Number Then
Err.Raise Err.Number, , Err.Description
"I realize it's an error, but no one is going to try to do that!"
From "Top 10 Stupid Comments from Developers".
re: For Tarun...... Please help
In the future Chillyhouse, please just send Tarun a private message, when asking for special help--else this technical board will start to look like a social blog.
Sorry for that Terry and thanks for taking the time to post
any update on this?
the main problem is on how to read a binary file on VBScript?
chillyhouse, this was just a 1 min search on google. I dont know why you had to wait so much
Buy the NEW QTP Descriptive Programming Unplugged Book
** Download QTP Unplugged 2nd Edition eBook for FREE **
Thanks a lot , I searched google before I post my question.However I didn't get the same results [img]/images/graemlins/frown.gif[/img]
Neways i was in Miami 2 days back, nice place to live around.