Unexpected empty lines when using MAcro to saveas document

O

Onno B.

We export asci files from SAP/R3 and open them with a Word (XP SP3 English)
macro like
Documents.open export.txt

In this file every record is on one line ended with CRLF (checked this with
an hexeditor). But when we do nothing but saving (and implicit converting)
the file using
Activedocument.saves filename:="export.doc", fileformat:=wdFormatdocument

SOMETIMES there is an unexpected empty line in export.doc, when it occurs it
can be reproduced (I have an example) but when we first edit export.txt using
notepad it sometimes dissapears and sometimes not.

I think it's a bug or so, we need the conversion to Word format as we use
this document as secondary merge file.
We have isolated the problem to the saveas command in the macro when trying
to do the same without macro (use file -> saveas) the problem does not occur.

Please advice ?.
 
J

Jezebel

It would be a little easier if you could actually state what problem you're
trying to solve. Are you trying to eliminate empty lines in your output
file? Do they matter? -- if so, why?
 
O

Onno B.

I do not want empty lines in my output file when they do not exist in my
input file. Word just generates these lines unexpected. (Also tested this
with Word 2003 SP1 but same behavior).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top