1

I've been saddled with supporting an old Access 2003 database (with SQL backend) produced by a now out-of-business contractor.

The database includes several 'unconventional' reports. They all use Automation through VBA to output fields directly to a Word document. Kind of like this (pseudo code):

for each row{
      output(row.id);
      moveRight();
      output(row.firstName);
      newLine();
}

Etc.

The problem is, the database includes several rich text fields. To output these (including their formatting) to the document, the developer opens a separate Access form, with a single rich text control, and pulls the appropriate field into the text box.

He then does a 'select all, copy', flicks back to Word, and then pastes the text.

My task is to add a new rich text field to a report, and I feel there must be a better way of doing this...

Berkay Turancı
  • 3,373
  • 4
  • 32
  • 45
ChristianLinnell
  • 1,368
  • 2
  • 16
  • 22
  • It would be easier if he'd created a generic way of accessing the functionality. As it stands each report uses a slightly modified copy/ paste of the code. I'm struggling to be nice about this contractor's (Daily WTF-worthy) code. – ChristianLinnell Apr 28 '09 at 02:48

1 Answers1

1

Ah! A duplicate question apparently.

Here's the answer:

Word Automation: Write RTF text without going through clipboard

Community
  • 1
  • 1
ChristianLinnell
  • 1,368
  • 2
  • 16
  • 22