Following this
http://support.microsoft.com/kb/301070

So it works fine on text file, but fails on anything like word or excel files. Try it and you'll see!

Why? Does it need to read/written in binary.
Any help is greatly appreciated.

Dim fsInput As New FileStream(sInputFilename, _
FileMode.Open, FileAccess.Read)
...
..
.
'Read the file text to the byte array.
Dim bytearrayinput(fsInput.Length - 1) As Byte
fsInput.Read(bytearrayinput, 0, bytearrayinput.Length)

=============
The code is opening and reading a TEXT file. You have to open the file in BINARY mode and read the content from it.

READ BINARY FILE:
bytearrayinput = My.Computer.FileSystem.ReadAllBytes("C:\Test.Doc")

Hope it helps.