Solved

Automated Document Creation

Posted on 2004-09-02
6
776 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 500 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

If your app took Google’s lash recently, here are the 5 most likely reasons.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This video demonstrates basic masking and how to edit the mask to reveal the desired image.
Viewers will learn how to use the Hootsuite Dashboard.

730 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