You are here: TextDynamic OCX
Move back to: Products
Move to: [Order]
Common:

Search for:

Step by Step Example in MS Access

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 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.

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. = '{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.

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.Top = 0
WPDLLInt0.Width = InsideWidth - 2
WPDLLInt0.Height = InsideHeight - 2
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.

Picture: RTF editor in MS Access -

Go to: Step by Step Example in VB6 TextDynamic OCX