exporting a record from a database to a MS Word document.

Discussion in 'Python' started by Levi Campbell, May 6, 2007.

  1. Is there a way to export a record from a database kept with bsddb to
    MS Word, possibly with some type of formatting data?
     
    Levi Campbell, May 6, 2007
    #1
    1. Advertising

  2. Levi Campbell

    ici Guest

    Levi Campbell wrote:
    > Is there a way to export a record from a database kept with bsddb to
    > MS Word, possibly with some type of formatting data?


    import win32com.client

    try: import psyco; psyco.full()
    except ImportError: pass

    app = win32com.client.Dispatch("Word.Application")
    app.Visible = True
    doc = app.Documents.Add()
    para = doc.Paragraphs.Add()
    para.Range.Text = "DB Record"
    para.Range.Bold = True
    #...
    doc.Close(True)
    app.Quit()
     
    ici, May 6, 2007
    #2
    1. Advertising

  3. Levi Campbell

    ici Guest

    Levi Campbell wrote:
    > Is there a way to export a record from a database kept with bsddb to
    > MS Word, possibly with some type of formatting data?


    import win32com.client

    try: import psyco; psyco.full()
    except ImportError: pass

    app = win32com.client.Dispatch("Word.Application")
    app.Visible = True
    doc = app.Documents.Add()
    para = doc.Paragraphs.Add()
    para.Range.Text = "DB Record"
    para.Range.Bold = True
    #...
    doc.Close(True)
    app.Quit()
     
    ici, May 6, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,425
    Carl Prothman [MVP]
    Jan 12, 2005
  2. srk
    Replies:
    0
    Views:
    691
  3. srk
    Replies:
    0
    Views:
    646
  4. saikrishna

    Exporting RDLC report to Word document

    saikrishna, Nov 19, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    2,453
    saikrishna
    Nov 19, 2009
  5. Michael G. Schneider

    Modifying a Word document without using Word Automation

    Michael G. Schneider, Dec 15, 2003, in forum: ASP General
    Replies:
    5
    Views:
    324
    el.c. - myLittleTools.net
    Dec 16, 2003
Loading...

Share This Page