In Python how to know microsoft document save progerss (I am saving doc using win32c)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SukumarMaddineni1
    New Member
    • Jun 2010
    • 2

    In Python how to know microsoft document save progerss (I am saving doc using win32c)

    Hi..

    I am saving microsoft doc using win32com. It saving perfectly. When I save a big document like 2000 pages, it is taking time. So meanwhile I need to show user that out of 2000 pages this many pages are converted. so that user will know process is inrpogress.

    my sample code is here . please tell me how to get save progress status code.

    ------------------------------

    import win32com.client .dynamic

    docpath = r"E:\\doctest\\ sukutest.docx"
    pspath = r"E:\\doctest\\ sukutest.pdf"
    MicrosoftDoc = win32com.client .dynamic.Dispat ch("Word.Applic ation ")
    try:

    print 'started opening doc'
    word =MicrosoftDoc.D ocuments.Open(d ocpath, False, False, False)
    outputFile = pspath
    print 'started saving doc'
    word.SaveAs(out putFile, 17)
    # *** my doc is very big doc, it takes time, so users are not knowing whether it is running or strucked some where
    print 'saving doc completed'
    word.Close()
    print 'every thing comepleted'
    except Exception, e:
    print e
    finally:
    MicrosoftDoc.Qu it()
    del word
    print 'final done'
Working...