• InsertLineBreaks–But they don’t! (Word XP / Win XP)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » InsertLineBreaks–But they don’t! (Word XP / Win XP)

    Author
    Topic
    #378645

    Forgive me, for I know nothing about WordXP–and we’re converting this weekend….

    If anyone can help out, I would very much appreciate it.

    What I’m trying to do: We have Word documents that need to be uploaded to a mainframe. In order to upload the documents, the lines need to be a maximum of 70 characters in length. If they’re longer, the lines cut off when uploaded.

    My current solution: In Word97, I can format a document so that it will have no more than 70 characters per line, then save it in a Text format that adds line breaks at the end of each line. The command is as simple as ActiveDocument.SaveAs FileFormat:=wdFormatTextLineBreaks.

    What _should_ be the solution: In XP, the above command doesn’t work (generates an error). The code in XP looks like this: ActiveDocument.SaveAs FileFormat:= wdFormatText, InsertLineBreaks:=True, LineEnding:=wdCRLF.

    The problem: The code for XP does NOT work. I don’t know why. If you save the file manually (by clicking on File–>Save As), you click on Insert Line Breaks and choose the line eding of CRLF. When you open the document, it looks great, with line breaks in all the proper place. But when you try to do this through code, it doesn’t do anything.

    Has anyone tried to do anything similar? Any ideas of what I should be looking for to make this work properly?

    TIA!

    Cecilia 🙂
    Hoping that this is not a sign of XP things to come.

    Viewing 0 reply threads
    Author
    Replies
    • #630152

      I don’t have XP handy, but the online doc suggests that the old syntax should still work. Might have to install extra text converters if they aren’t in your standard install.

      MSDN Home > MSDN Library > Microsoft Office > SaveAs Method (click WdSaveFormat)

      • #630485

        Thanks. Unfortunately, I cannot install anything in XP–that’s why they upgraded us, for control. I know the documentation shows that it should work, but apparently it’s not. I’ve given up on this project, so don’t worry about it. Thanks for the try 😉

    Viewing 0 reply threads
    Reply To: InsertLineBreaks–But they don’t! (Word XP / Win XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: