none
Delimiter for Documents.Paragraphs with MS Word RRS feed

  • Question

  • In Visual Basic for Applications, what does Documents.Paragraphs use as a delimiter for the paragraphs in MS Word?
    Please provide a web reference.
    Friday, August 5, 2011 12:23 AM

All replies

  • If you are looking at characters in Range objects, a carriage return (ascii 13) is used to mark the end of a paragraph. Normally, however, you wouldn't be using this, so can you say what it is you are trying to do?
     

    Enjoy,
    Tony
    www.WordArticles.com
    Friday, August 5, 2011 6:10 AM
  • I am trying to separate a Microsoft Word document into paragraphs, so I can convert the Word document into an XML document. I need a way for the program to discern the end of each paragraph.
    NetworkArchitecture
    Friday, August 5, 2011 10:52 AM
  • If you're using VBA then the Document.Paragraphs Collection will give you the paragraphs one by one. If you want to drop the final Character you can, without needing to know what it is.
     
    But, you can create XML directly from Word (2003 or later) and doing that and running an XLST to get the result you want would almost certainly be a better bet.
     

    Enjoy,
    Tony
    www.WordArticles.com
    Friday, August 5, 2011 11:40 AM
  • The text in Word must be extracted, and placed in an XML template which complies with an XSD schema.
    NetworkArchitecture
    Friday, August 5, 2011 12:03 PM
  • Yes - I have answered your original question, and given you an alternative approach. Do you need any more information?
     

    Enjoy,
    Tony
    www.WordArticles.com
    Friday, August 5, 2011 12:07 PM
  • How do I convert a Word 2007 document to XML?

    Also, what is a good book for learning XLST?

     


    NetworkArchitecture
    Friday, August 5, 2011 12:31 PM
  • Well, Word 2007-format documents are zipped packages of multiple xml files. Rename a .docx file as .zip and open it - the file called word/document.xml contains all the text (and some structural detail, all within tags), so you can ignore the rest if that's all you want.

    I don't know enough about XLST, and nothing at all about books on the subject, to be able to make any recommendations - sorry.
     

    Enjoy,
    Tony
    www.WordArticles.com
    Friday, August 5, 2011 12:41 PM