Solved

Automated Document Creation

Posted on 2004-09-02
6
758 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-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now