Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

Paste sentence into Access Table "memo" field

$
0
0

I have a *.docm document that I use to load sentences of text into a Memo field of an Access table.

Right now I use the following syntax to loop through the sentences in the document and load them into each record of the table:

With ActiveDocument
  .Select
  For IX = 1 To Selection.Sentences.Count    rstSentences.AddNew
    rstSentences!Book = intBook
    rstSentences!Chapter = intChapter    rstSentences!Sentence = IX    rstSentences!Text = Right(Selection.Sentences(IX), Len(Selection.Sentences(IX)) - 2)    rstSentences.Update
  Next IX
End With

The syntax of Right(Selection.Sentences(IX), Len...etc is to remove some leading text which included old sentence numbering.

This is working fine, except that I would like to retain the actual formatting of the text.

If I were to manually Copy a specific sentence and then open the Table in Access andPaste it into the "Text" field of the table...the actual formatted text appears (with different sized fonts or different colors in places that I have edited it as).

Any idea how I could change the rstSentences!Text line to make a "Paste" into it?

Thanks for your time in advance.


Paul D. Goldstein Forceware Systems, Inc.


Viewing all articles
Browse latest Browse all 4350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>