Solved

Automated Document Creation

Posted on 2004-09-02
6
745 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
Comment Utility
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
Comment Utility
how would you suggest creating my own? (i.e. what applications)
0
 
LVL 10

Expert Comment

by:winzig
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 20

Author Comment

by:DVation191
Comment Utility
if only i knew how to program VB
0
 
LVL 10

Expert Comment

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

Expert Comment

by:MichaelHarvey
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Ticketing System/ Asset Tag tracking. 4 41
Tool to format notepad++ 1 66
Image Deployment Tool 9 65
Dentrix G4 1 30
A list of useful business intelligence software.
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 how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
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.

744 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

16 Experts available now in Live!

Get 1:1 Help Now