Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    InsertLineBreaks--But they don't! (Word XP / Win XP)

    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.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: InsertLineBreaks--But they don't! (Word XP / Win XP)

    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)

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: InsertLineBreaks--But they don't! (Word XP / Win XP)

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •