خرید بک لینک

Vote count: 0

What I want to do

I have an Access database ( C:Users289894DesktopDatabase1.accdb ) One of the fields of [Table1] is [Memo].

That field is of the Memo data type, with the text format set to rich text. It makes it possible to save some records as Bold and some records saved as Italics, for example.

I want to open a coexion to this Access database from an excel file in order to read/write into this rich text field.

The code I used is the following:

    Dim datab As Database
    Dim rs As Recordset
    Dim path As String

    path = "C:Users289894DesktopDatabase1.accdb"

    Set datab = OpenDatabase(path)
    Set rs = datab.OpenRecordset("SELECT * FROM [Table1]")

        Debug.Print rs!Memo
        Range("A1") = rs!Memo

My question

This code works well to open a coexion and read ordinary text fields, but rich text acts in a surprising way (for me). The original text in access was "aaa". That's "aaa" in bold font.

After ruing the code, both the debug.print and Range("A1") have <div><strong>aaa</strong></div> written into them.

How can I change my code to send the format to excel as well? I'd like to have "aaa" written in bold in cell A1, just like it is in Access.

asked 37 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 16 تير 1395 ساعت: 0:00

صفحه بندی