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. Advertisements

  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. Advertisements

  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. Advertisements

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. =?Utf-8?B?Tm92aWNl?=

    Generating Word document from information in Database

    =?Utf-8?B?Tm92aWNl?=, Jun 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    563
    =?Utf-8?B?Tm92aWNl?=
    Jun 9, 2004
  2. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,604
    Carl Prothman [MVP]
    Jan 12, 2005
  3. Simon
    Replies:
    2
    Views:
    845
    Simon
    Oct 28, 2005
  4. Simon
    Replies:
    3
    Views:
    685
    Daniel Walzenbach
    Nov 9, 2005
  5. srk
    Replies:
    0
    Views:
    858
  6. srk
    Replies:
    0
    Views:
    796
  7. saikrishna

    Exporting RDLC report to Word document

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

    Modifying a Word document without using Word Automation

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