Step by Step use in Access

[Top]  [Chapter]  [Previous]  [Next]

1) Create an empty database

2) Create a table in this database with text fields and at least one blob field too ho0ld the data of the editor. Please choose the field type "OleObject". The type Memo will not work correctly since it is not only limited to 64KB but also does text conversion which can result in the destruction of binary data. The data used to store the formatted text is plain ASCII code with the binary data of embedded images.

3) Create Form (click on the button clip0117 and select the the table we just created for it).

 

In our example we deactived the scrollbars and the datarecord marker.

 

Insert the ActiveX control (use menu "Insert") TextDynamic. It should now look like the following screenshot.

access_form

 

4) Now you can add code to initialize the control.

 

Select the CODE view and add an event handler for the Forrm Event: OnLoad

 

Private Sub Form_Load()

 ' This code requires the respective key to be set in the registry

 ' WPDLLInt0.DLLName = '{hkcu}Software\MyCompany\TextDynamic\path'

 

 ' Initialize License

 WPDLLInt0.EditorStart "licensename", "licensekey"

 

' load the PCC file

 WPDLLInt0.SetLayout ".\buttons.pcc", "default", "", "main", "main"

' Select a single editor with small toolbar

 WPDLLInt0.SetEditorMode 0, 93, 302, 0

' Select normal page layout

 WPDLLInt0.SetLayoutMode 0, 0, 100

End Sub

 

Note: The modification of the DLLName and the call to EditorStart is required in an application you are distibuting.

 

5) As source for the contents select the OleObject field from our table ("LETTER").

 

This field will be automatically selected for the source for property Text - any updates will be posted there as well.

 

Usually binary data is written.

 

You can set property TextFormat = "AUTO-useolestring" to write a standard (2-byte) OLE strings.

 

6) Now add an event to resize the control according to the form:

 

Click on View/Code and add this event handler

 

Private Sub Form_Resize()

 WPDLLInt0.Left = 0

 WPDLLInt0.Width = InsideWidth - 32

 WPDLLInt0.Height = InsideHeight WPDLLInt0.Top - 32

End Sub

 

Close the VB editor and also the form. Save the form as "MainForm"

 

6) Start the application

 

You should see a form with a read to use editor which automatically saves and loads the contents from a the binary field in the created table.

 

access_rtf_editor

 

7) Add mail merge in MS Access

 

The template to do mail merge can be either stored in a separate template table or in external files. In any case we need a form to edit the text. Such a form can be created as previously described.

 

The important change is added code which inserts fields which can be later filled with  data loaded from other tables in the project.

 

 


[stepbystepuseinaccess.htm]    Copyright © 2007 by WPCubed GmbH