?
Solved

Automated Document Creation

Posted on 2004-09-02
6
Medium Priority
?
788 Views
Last Modified: 2012-06-27
A client of mine has some numerous documents to compile everytime there is a new prospect from the sales team. These documents are currently generated by hand, mostly by copy and pasting from previous documents.

Every document is unique, however, in that every prospect is different and every situation is different. What I had in mind was some way to to able to generate a document based on picking or filling out some kind of generic form.

For example. The input could be something like this...
Client or Prospect? --> Prospect
Client/Prospect Name? --> SampleCompany
Private or Public? --> Public
Dental / Medical / Life? --> Dental and Medical

Which would generate a document that uses paragraphs that correspond to the choices made.
Does such a solution exist?
0
Comment
Question by:DVation191
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
winzig earned 2000 total points
ID: 11966722
The law firms ussing ussualy HotDocs for this stuff.
http://www.hotdocs.com/

But for some things you can create your OWN templates,
0
 
LVL 20

Author Comment

by:DVation191
ID: 11967808
how would you suggest creating my own? (i.e. what applications)
0
 
LVL 10

Expert Comment

by:winzig
ID: 11968485
Few years ago I wrote my own application which were able create document from small parts. And i wrtote the Application in VB in which client selected segments of the document from the tree and then i buid up the MS Word document. From that segments.  
It's also posible to build up documents which will be based on same form. (ussualy on same DB record)

I give you 2 fragments of my Code - Com+ Plugin for MS Oulook. So you will se haw you can work with MS Word document from your application.

1st fragment replaces bookmarks by values from contact.  
       Set oapp = CreateObject("word.application")
        oapp.Visible = True
        If template = "" Then
            MsgBox LngGetText(402) '"Není definována šablona"
            Exit Sub
        Else
        End If
        For c = 1 To Selection.Count
            If c = 1 Or OneFile = False Then
                oapp.Documents.Add template:=template, NewTemplate:=False, DocumentType:=0
                If oapp.ActiveDocument.Bookmarks.Count = 0 Then
                    MsgBox LngGetText(403) '"V Šablone nejsou definovány Bookmarks!"
                    Exit Sub
                End If
            Else
                oapp.Selection.EndKey Unit:=6
                oapp.Selection.InsertBreak Type:=2
                oapp.Selection.InsertFile Filename:=template, Link:=False, Attachment:=False

            End If
            With oapp.ActiveDocument.Bookmarks
            book = 1
            Do While book <= oapp.ActiveDocument.Bookmarks.Count
                bookname = .item(book)
                value = getContactItem(Selection.item(c), ContactSender, bookname)
                If IsEmpty(value) = False Then
                    oapp.Selection.GoTo What:=-1, Name:=bookname
                    oapp.Selection.TypeText value
                    .item(book).Delete
                    Else
                    book = book + 1
                End If
            Loop
            End With
            Fields2Text oapp.ActiveDocument
        Next c


'=============================================
and the secong gragment do the same thing with  the MergeFields
        If template = "" Then
            MsgBox LngGetText(402) ' "Není definována šablona"
            Exit Sub
        Else
        End If
        Set oapp = CreateObject("word.application")
        oapp.Visible = True
        For c = 1 To Selection.Count
            If c = 1 Or OneFile = False Then
                oapp.Documents.Add template:=template, NewTemplate:=False, DocumentType:=0
                If oapp.ActiveDocument.MailMerge.Fields.Count = 0 Then
                    MsgBox LngGetText(403) '"V Šablone nejsou definovány Merge Fields!"
                    Exit Sub
                End If
            Else
               'oapp.Selection.MoveDown Unit:=6, Count:=1
                oapp.Selection.EndKey Unit:=6
                oapp.Selection.InsertBreak Type:=2 'wdSectionBreakNextPage
                oapp.Selection.InsertFile Filename:=template, Link:=False, Attachment:=False
            End If
            With oapp.ActiveDocument.MailMerge.Fields
            book = 1
            Do While book <= .Count
                bookname = .item(book).code.Text
                If Left(bookname, 12) = " MERGEFIELD " Then
                    bookname = Mid(bookname, 14, Len(bookname) - 15)
                    value = getContactItem(Selection.item(c), ContactSender, bookname)
                    If IsEmpty(value) = False Then
                        .item(book).Select
                        If value = "" Then
                            oapp.Selection.Delete
                        Else
                            oapp.Selection.TypeText (value)
                        End If
                    Else
                        book = book + 1
                    End If
                End If
            Loop
            End With
            Fields2Text oapp.ActiveDocument
        Next c




Sub Fields2Text(ActiveDocument As Object)
On Error GoTo ErrHndlr
Dim c As Integer
    For c = 1 To ActiveDocument.Fields.Count
        ActiveDocument.Fields.item(c).UpdateSource
        ActiveDocument.Fields.item(c).Unlink
    Next c
Exit Sub
ErrHndlr:
    Err.Clear
End Sub
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 20

Author Comment

by:DVation191
ID: 11968826
if only i knew how to program VB
0
 
LVL 10

Expert Comment

by:winzig
ID: 11968930
If you dont know it You can use HotDocs :)
0
 
LVL 1

Expert Comment

by:MichaelHarvey
ID: 23382287
Obviously this is an old topic but as it seems to be quite a unique question it should be pointed out that there are several other options apart from Hot Docs.  We use Exari (www.exari.com) as it doesn't use word plugins but rather it is stand alone with a decent web interview.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question