Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put Statement

Status
Not open for further replies.

MacroManII

Programmer
Nov 14, 2002
22
US
I am using the put statement as follows


Open sGetFile For Binary As #1

While oFolder.Items.Count > 0

For Each oMailItem In oFolder.Items

If oMailItem.Body <> &quot;&quot; Then
Put #1, , oMailItem.Body
End If
oMailItem.Delete

Next oMailItem

Wend

But I am getting erroneous output to the file as follows

 Âì910070006 6375

The characters up to the 910070006 are not in the mail item body at all, yet they appear at the start of the output file.

MacroManII
 
It looks as if 'Put' is seeing oMailItem.Body as a Variant, since you haven't explicitly converted it to string.

If that's the case then Put includes a 2-byte variable type indicator and a 2-byte string length before the actual data.

Check out 'Put Statement' in VBHelp


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
johnwm

Thank you very much.

That solved my problem

Regards

MacroManII
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top