Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Legal Document w/ line numbers

Status
Not open for further replies.

jazminecat23

Programmer
Mar 16, 2007
103
US
Hi all - has anyone had success creating a report with the line numbering down the side that legal documents require? I'm working on a system for a law office that needs this.

Thanks.
 
It should be possible to use an unbound textbox with Running Sum.
 
Hm, that's an interesting prospect. What I am supposed to be doing is creating a system for them to autogenerate their documents, filling them in with information from the active form record, and/or from parameters they fill in when they open the report. So, for example, they'd have a disposition with the name, date, and attorney from the active record. That info needs to be inserted into the text, and then the document generated from that, with numbering down the side for every line. In addition, the text is not all formatted the same. Items like the defendant name are in all caps, and the first part of the document is title info and it's centered and bolded on the page. So is it possible to have one unbound text box with different formatting for different parts of the text?

Or does that numbering text box go down the side of the report and just line up with any other text boxes I have?
 
If your line spacing is consistent from top to bottom, you can add a tiny bit of code in the On Page event of your report:
Code:
Private Sub Report_Page()
    Dim intVertSpacing As Integer
    Dim intNum As Integer
    intVertSpacing = 1440 / 4 '1/4 inch
    For intNum = 1 To 36
        Me.CurrentY = intNum * intVertSpacing
        Me.CurrentX = 0   'left margin
        Me.Print intNum
    Next
End Sub

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Ok cool - I'll give that a shot and report back. Thanks Duane!
 
Hm, ok that sort of works, but it actually looks like the numbers are moving slightly to the right as the text goes down the page. Plus, I can't get my text box, which is based on a memo field, to show everything that's in the field and expand over onto the next page. Some of these reports will need to be 3 or 4 pages long. Can I make a text box wrap that far?

I'm wondering if I'm going about this the wrong way. Is there a way to have the user fill out a form in Access and then have it take that data and populate a word form perhaps? I'd rather not do that, as I don't trust them not to screw up the word document...
 
Performing a merge to Word might be your best solution. I generally export a query to merge file and then connect the document to the merge file.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
can I run the merge and everything in the background? I mean, can I launch word, populate the merge file, create the document, print it, and close word in the background, coming back to access when finished? So that it just does it without the user having to go from one application to the other, or interact with word at all. I'd really like to keep this in one application, from the user's point of view, if at all possible. My users are afraid of their computers and can't run a mail merge without explicit instructions and adult supervision...
 
I think all of that is possible. What have you done to research it? I would try Google first and make sure you include the word "Automation".

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Cool. I'll start there, and with the archives, and see what I can come up with. I know i have some code somewhere on launching word, so that's a start. Good to know it's possible. i'm sure I'll be back if I get stuck (which I'm sure I will) but i'll mess with it first and see how far I can get. Thanks a million for the direction - I appreciate it!
 
jazminecat23
This code was originally taken from the TT forum (can't recall where) but it does open Word / deposit bookmark text etc

Code:
Dim dbs As Database
   Dim objWord As Object
   Dim PrintResponse
   Set dbs = CurrentDb
   
   'create reference to Word Object
   
   Set objWord = CreateObject("Word.Application")
   
   'Word Object is created - assign bookmarks with data.
   
   With objWord
       .Visible = True
       .Documents.Open (set path and document details here  "\WordDocs\mydocument.doc")
       'move to each bookmark, and insert correct text.
    .ActiveDocument.Bookmarks("Client").Select
    .Selection.Text = (CStr(Forms!frmportfolioentry![PolInsured]))
    .ActiveDocument.Bookmarks("Broker").Select
    .Selection.Text = (CStr(Forms!frmportfolioentry![BrName]))
    .ActiveDocument.Bookmarks("subject").Select
    .Selection.Text = (CStr(Forms!frmportfolioentry![subject]))
    .ActiveDocument.Bookmarks("Policy1").Select
    .Selection.Text = (CStr(Forms!frmportfolioentry![PolPolicyno]))
    .ActiveDocument.Bookmarks("CoverFrom").Select
    .Selection.Text = (CStr(Forms!frmportfolioentry![PolCoverFrom]))
    .ActiveDocument.Bookmarks("Contact").Select
    .Selection.Text = (CStr(Forms!frmportfolioentry![BrName]))
    
      
   End With

   'Print the document
    objWord.ActiveDocument.PrintOut Background:=False
      
   'release all objects
         
        With objWord
       .Visible = False
       .Quit False

       End With
       
   Set objWord = Nothing
   Set dbs = Nothing
You could probably adapt this to suit your needs, I would suggest that the document is saved "hidden" to avoid users messing with it.

Happiness is...not getting what you want but wanting what you have already got
 
Binnit - thanks! I'll give that a try as well. Thanks a lot for the assistance!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top