Solved

Automated Document Creation

Posted on 2004-09-02
6
771 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
  • 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What does Survey Monkey cost? 7 144
Open Source: Multi-Level-Marketing software? 3 182
Any free software for printscreens 7 96
mobile app idea 17 88
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
This video shows how use content aware, what it’s used for, and when to use it over other tools.
The viewer will learn how to create multiple layers to apply various filters and how to delete areas from each layer’s filter.

807 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