K
Karl E. Peterson
Ed said:Oh, please Mr. Wizard!! Point me to something better!! Then again, I
don't know if I could use it - this is for work and I'm stuck with
what I have: Office and VBA, and VB6 (I can probably find someone with
dot Fred). Then, too, I'm also stuck with what I know - which
obviously isn't much!!
Well, for this task, I'm having trouble seeing the utility of Word. I'll grant it's
convenient. I mean, there it is. But why drag the object model into it? VBA alone
can do it. (I'd personally use VB6, myself.)
Well, I did try
myText = Replace(myText, Chr(13), Chr(13) & Chr(10), 1, ,
vbBinaryCompare)
but it didn't seem to work. Bad syntax? Bad breath?
Dunno. <g> I'd have to see a sample of the raw data, but I suspect you're probably
getting hosed by the object model, not your breath. I mentioned a hex editor
before, eh? That's a way to look at your actual data. I use Cygnus (from
Softcircuits). Not sure if they offer an evaluation period. You can also dump your
strings to the Immediate window using my HexDump sample
(http://vb.mvps.org/samples/HexDump), though I'd use rather short ones - no
multimegabyte unless you're really bored.
It sure seems harder than I thought it would be! But when you're
using a screwdriver to pound nails, it's _all_ hard! <G>
Okay, *now* you're starting to hear me! <g>
So, to recap... You have:
strMsg = docIE.Body.InnerText
Now, do this:
strMsg = Replace(strMsg, vbCr, vbCrLf)
Call WriteFile(MyFilename, strMsg)
That's it! If that doesn't look right in Notepad, look at it in a Hex editor. Make
sure you're not doubling put the LFs (no 13/10/10 triplets). Or, add my HexDump.bas
module to your project, and do this:
Call HexDump(StrPtr(strMsg), 800) 'about 10 lines?
And show us the results here.