none
Converting a IBM Mainframe Report into a WORD Document RRS feed

  • Question

  • I have a mainframe report that I want to convert into a WORD Document.  I want to preserve the page breaks.  So, how could I do that?  Is there a special ASCII character string that signals NEW PAGE?

    Has anybody done this?

    Monday, May 2, 2011 2:24 PM

Answers

  • Hi Daniel

    "Purists" would format the first paragraph of the following page with "Page Break Before" (rng.PageBreakBefore), rather than a "hard" page break. As the use of the one or the other can under certain circumstances change formatting and layout of text around the page break it would probably be a good idea to test using both approaches before settling on one.

    The ANSI character for a page break in Word is 12. If you're working in the Word object model, you can also use Range.InsertBreak Type:=wdPageBreak


    Cindy Meister, VSTO/Word MVP
    Monday, May 2, 2011 3:43 PM
    Moderator
  • Peter,

    Thank you for your help.  I was able to figure how to do this.

     

    Dan

    Tuesday, May 3, 2011 5:04 PM

All replies

  • Hi Daniel

    "Purists" would format the first paragraph of the following page with "Page Break Before" (rng.PageBreakBefore), rather than a "hard" page break. As the use of the one or the other can under certain circumstances change formatting and layout of text around the page break it would probably be a good idea to test using both approaches before settling on one.

    The ANSI character for a page break in Word is 12. If you're working in the Word object model, you can also use Range.InsertBreak Type:=wdPageBreak


    Cindy Meister, VSTO/Word MVP
    Monday, May 2, 2011 3:43 PM
    Moderator
  • OK, tried that and it appears to work.  On the IBM Mainframe, the first byte of every line has a Carriage Control.  For example, New Page is a "1", a double space is a "0", and a triple space is a "-".  Are there ASCII or WORD control fields for double space or triple space?
    Monday, May 2, 2011 3:52 PM
  • Hi Daniel

    No. "In principle" you aren't supposed to use double or triple spaces in Word. It will let you (although some grammar check settings will mark them), but there are no special control characters for creating such things.

    If what you need are "spaces" in order to generate columns of text the better approach is to set Tab Stops and use a TAB character (ANSI 9) instead of n spaces. Or use a Table.


    Cindy Meister, VSTO/Word MVP
    Monday, May 2, 2011 4:02 PM
    Moderator
  • Looking at this another way,

     a. how are you opening your file in Word?

     b. what is the encoding of the file you are opening? Is it EBCDIC? Are you being asked to specify that encoding when you open your file?

     c. when you open the file, does each line, or paragraph (they are different) in Word still show a character that should be interpreted as a "formatting" character? If so, it may make sense to do a global Find/Replace in Word to replace each such character by a suitable Word equivalent. If so, can you point to a list of all the "Carriage Control" characters that might occur either in your document, or in any such document.

     


    Peter Jamieson
    Monday, May 2, 2011 6:35 PM
  • Peter,

    Thank you for your help.  I was able to figure how to do this.

     

    Dan

    Tuesday, May 3, 2011 5:04 PM
  • Cindy,

     

    I want to thank you for you help.  I was able to locate a procedure in the source system (IBM Mainframe) that converts my reports into a PDF.  So, as it turns out I didn't have to use WORD....this time....

     

    Thank you again.

    Wednesday, May 4, 2011 1:01 PM