#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Extract sections of word doc into seperate files using a scripting language


    Can someone let me know if it is possible to break a word document, section-wise and make each section a new word document including the text and diagram in it. Also the name of the document is the title of the section.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,854
    Rep Power
    481
    I would think it's possible using whatever version of BASIC is the language of Word macros. I've written excel macros, but not Word macros, and I'm not offering to do the job.

    But anyway, my advice: investigate the MSWord macro language features or ask at a Microsoft forum.

    I'm quite sure that the unix split program will not make useful partitions of a .doc file in the way you intend.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    12
    Rep Power
    0
    Just curious, are you attempting some automation, or is it just one time job.

    Anyway, you will have use the win32 module from python and read the COM object model (from microsoft). I am sure some of those functions should help you what you need. For splitting the doc, you should be clear what defines a section, I mean there are different heading styles which are supported.
    In short it is not trivial.

    http://msdn.microsoft.com/en-us/library/bb244515%28v=office.12%29.aspx

IMN logo majestic logo threadwatch logo seochat tools logo