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 ?.

--
MCSE Admin for medium organisation

Re: Unexpected empty lines when using MAcro to saveas document by Jezebel

Jezebel
Mon May 02 05:47:51 CDT 2005

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?




"Onno B." <OnnoB@discussions.microsoft.com> wrote in message
news:B5ECEC32-9C26-49A2-8E3C-6A04AE5917CE@microsoft.com...
> 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 ?.
>
> --
> MCSE Admin for medium organisation



Re: Unexpected empty lines when using MAcro to saveas document by OnnoB

OnnoB
Mon May 02 06:12:03 CDT 2005

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).

--
MCSE Admin for medium organisation


"Jezebel" wrote:

> 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?
>
>
>
>
> "Onno B." <OnnoB@discussions.microsoft.com> wrote in message
> news:B5ECEC32-9C26-49A2-8E3C-6A04AE5917CE@microsoft.com...
> > 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 ?.
> >
> > --
> > MCSE Admin for medium organisation
>
>
>