Jumat, 19 Desember 2014

Re: [MS_AccessPros] Convert reports (letters with if conditions) from Access 2013 to Word 2013

 

Norbert,

 

I've built a number of Access based tools that result in either letters or messages being generated with data from various tables being included in the resultant communication.  In the case of MS Word letters, I get the users to build actual MS Word templates (*.dotx) files.  Then I open the template from Access using a Word object.

 

The whole process works well and it gives the users the ability to modify the templates at will.  This eliminates the need to have the verbiage for a letter in a table along with the issues of maintaining them and ensuring that the table row sequences are correct so that the letter makes sense.

 

The Access code replaces values in the letters with vales from the tables to personalize each letter prior to saving it.  All letters are saved in the same folder.  A 1-row table specifies where the letters are saved so for audit trail purposes, all that's saved for each letter is its name.  Users don't really need to know where the letters are saved in that the name is displayed on a form and double clicking on the name will open it at any time. 

I'm happy to share specifics along with various "gotcha's" to watch out for if you'd like to explore this course of action.  Your call.

 

Jeff
 


To: MS_Access_Professionals@yahoogroups.com
From: MS_Access_Professionals@yahoogroups.com
Date: Fri, 19 Dec 2014 05:26:03 -0800
Subject: [MS_AccessPros] Convert reports (letters with if conditions) from Access 2013 to Word 2013



        Happy Holidays!
Any suggestions how to use MERGEFIELD process with Automation using Access 2013 and Word 2013?


Many times a manager wants to change the content of a letter. The easier way instead of changing in the Access hard code procedure will be to change it in a Word Template.
As you can observe in the sample below there are case conditions which could be converted into a Word Template. I have no experience in this field and will appreciate any feedback.
Thanks a lot.
Norbert




Example:
The following is a partial code from a report which creates a letter in Access 2013:
(Sorry I can't format to change this code to a better view please advise if will help to post all the code of this procedure)


Select Case Me.CollectionMode
    Case "Ccard"
        Me.p_main = Me.p_main & " " & LCase(Me.EFTCollCycle) & " " & " credit card charge for the premium payment on your"
        If Me.prodcde <> "ANTY" Then
            Me.p_main = Me.p_main & " " & "FREEDOMFLEX life insurance underwritten by Fidelity Security Life Company has been declined."
        Else
            Me.p_main = Me.p_main & " " & "annuity underwritten by Fidelity Security Life has been declined."
        End If
        Me.p_main = Me.p_main & vbCrLf & vbCrLf & "This may have been an oversight, and perhaps it is still         your " & _ "desire to continue to have automatic premium payments charged to " & _
                         "your credit card each month.  If you wish to maintain your valuable plan, " & _
                         "please send us a personal check to replace the charge plus an additional " &                sp_nsf_ser_chg & _
                                         " service charge to cover our bank's charges as stated in your service agreement."
        If Me.prodcde <> "ANTY" Then
            Me.p_main2 = vbCrLf & "FAILURE TO PAY THE AMOUNT DUE MAY RESULT IN A LAPSE IN YOUR FREEDOMFLEX COVERAGE.  " & _
                         "ALTHOUGH WE MAY CONTINUE TO CHARGE YOUR CREDIT CARD WHEN YOU HAVE MISSED A PAYMENT, " & _
                         "YOUR COVERAGE MAY NOT BE IN FORCE IN THE EVENT OF A CLAIM AGAINST IT, IF THAT PAYMENT HAS NOT BEEN REMITTED."
        End If

    Case Else
        Me.p_main = Me.p_main & " " & "monthly Electronic Funds Transfer for the premium payment on your "
        If Me.prodcde <> "ANTY" Then
            Me.p_main = Me.p_main & " " & "FREEDOMFLEX life insurance underwritten by Fidelity Security Life has not been honored."
        Else
            Me.p_main = Me.p_main & " " & "annuity underwritten by Fidelity Security Life has not been honored."
        End If
        Me.p_main = Me.p_main & vbCrLf & vbCrLf & "This may have been an oversight, and perhaps it is still your " & _
                                         "desire to continue to have automatic premium deductions from your account each month. " & _
                                         "If you wish to maintain your valuable plan, please send us a personal check to replace the transfer " & _
                                         "plus an additional " & sp_nsf_ser_chg & " service charge to cover our bank's charges as stated in your service agreement. " & _
                                         "You may choose to make this payment through your credit card by contacting this office."
        If Me.prodcde <> "ANTY" Then
            Me.p_main2 = vbCrLf & "FAILURE TO PAY THE AMOUNT DUE MAY RESULT IN A LAPSE IN YOUR FREEDOMFLEX COVERAGE.  " & _
                         "ALTHOUGH WE MAY CONTINUE TO DRAFT WHEN YOU HAVE MISSED A PAYMENT, " & _
                         "YOUR COVERAGE MAY NOT BE IN FORCE IN THE EVENT OF A CLAIM AGAINST IT, IF THAT PAYMENT HAS NOT BEEN REMITTED."
       End If
End Select
'---------------------------------------Client name-------------------------------------------
If Not IsNothing(strClientMN) Then
        strClient = strClientFN & " " & strClientMN & " " & strClientLN
Else
        strClient = strClientFN & " " & strClientLN
End If
'----------------------------------------Payor Name-------------------------------------------
If Not IsNothing(strPayorFN) Then
        strPayor = strPayorFN & " " & strPayorLN
Else
        strPayor = strClient
End If
'----------------------------------head_*       -----------------------------------------------






--
---

Jeffrey Park Jones

919-671-9870
5109 Deer Lake Trail
Wake Forest, NC 27587
jpjones23@centurylink.net


__._,_.___

Posted by: jpjones23@centurylink.net
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

.

__,_._,___

Tidak ada komentar:

Posting Komentar