Transferring Rich Text data from Access to Word - vba

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

Ah! A duplicate question apparently.
Here's the answer:
Word Automation: Write RTF text without going through clipboard

Related

How to make a MS Word fillable form (with macros) usable for non-Office users?

I have created a fillable form in MS Word. It uses dropdown picklists and other fillable developer tools. It has two macros. The first depends on the users selection from one dropdown, and determines what values will be available in the second dropdown. The second depends on the users selection in the second dropdown, and determines what text will be displayed below (i.e. what questions the user will be asked).
Is there anyway to make this useable for people who are no MS Word users?
My initial thought is convert it to a pdf. But when it save the doc as a pdf it looses all form-filling functionality. (as if printed).

Batch alter existing PDF files

I have 1700 PDF datasheets that contain a set of text and image boxes. The underlying template of each datasheet is the same, but the contents of the boxes vary. I'd like to find a program that lets me take the modified text box contents (summarized in an excel table) and repopulate the original sheets.
I have extracted the information from the text boxes using the "Merge Data files into an excel file" under the Prepare Form tool in Adobe DC and have used a variety of =Substitute functions in excel to change the contents of the text boxes to what I want. What I would like to do now is use a program to go back to the original .PDF and overwrite the original fields. I would just run a mail merge on this normally, but I don't have access to the images anymore so the image boxes would be blank.
Alternatively I've considered using something like Pulover Macro Creator to step through the excel list and paste in the contents into every sheet, but I'm hoping that there's an existing piece of software to do this.

vb.net word automation - bookmarks

I am preparing to make mechanism to fill out word template. I want to fill out it by data from my program. I heard about word bookmarks that I could create and then from program put the data to it. Unfortunately I heard also that when I want to put same value in different places in word I need to prepare separated new bookmarks for it. For instance I want surname to be in 3 different places in word then i cannot use one bookmark for it. Is it true? If so is there any other way to do it?
Yes, you can fill out bookmarks from your program. Be aware of the two different types of bookmarks which are called open or closed (one is empty, the other contains text and you can replace parts of the text or the whole text).
Yes, you can use a bookmark name only once. But you can manipulate the bookmarks in your program when you use bookmarks like bookmark_1 and bookmark_2, so you can replace the same content on different places. Helpful is the object model (https://msdn.microsoft.com/en-us/library/ff841749%28v=office.14%29.aspx)

Locking text fields in embedded document

I have been tasked with updating a spreadsheet that produces a report by replacing text in a template. Previously, the worksheet referenced an outside/separate file-- my job is to get it working in an embedded document.
I currently have text form fields for every input I want to insert within the embedded document template. As it stands, users can edit the document template however they like, but if they accidentally erase a text form field (again, where text is replaced via the vba macro) then it will break the macro and the spreadsheet will be useless.
My question:
Is there some way to lock or protect text form fields such that the rest of the document is editable? I essentially want to have the inverse of a "text form field only" protection.
Alternatively, is there a better way to approach this project? I'm thinking of leaving the spreadsheet as is, but including a "reset" button bringing the template back to it's original state if anything breaks. If I did this method, this would require there NOT to be an external file. Attempts to do this so far have proven unsuccessful.
My general methodology/algorithm goes as follows:
Open the reference document
Replace all the text form fields via bookmarks with plain text,
making sure to reassign the bookmarks afterward (so as to not lose
them if they run the macro more than once).
Save the embedded document as a .doc with the inputs inserted
Replace all bookmarked inputs with text form fields to return the
template to its original state
Any information would be IMMENSELY appreciated. I am slowly running out of time and am feeling stuck.
Many thanks!
-Sooji

Lotus Notes rich text field to RTF File - VB

I am doing a data migration from Lotus notes to another type of software that does not support Rich Text Fields. I am trying to write a VB 2005 program that will take any rich text fields that are found and place them into an RTF file - which will be uploaded as an attachment in the new software.
I cannot get the program to take the rich text formating or objects to the RTF file, only the plain text. I have tried everything under the sun using the COM library to get these objects out to no avail.
Any ideas or suggestions?
Thank you in advance
Bryan
There is an undocumented C api call "ExportRTF". Julian Robichaux has an example of using it in a database here:
http://www.nsftools.com/tips/NotesTips.htm#rtfexport
"Here's a database I wrote with some code that allows you to export the information in a Notes rich text field to an RTF file, while retaining most or all of the rich text field formatting. It also demonstrates how to write multiple things to a single RTF file (including multiple rich text fields), if that's something you're interested in doing. Additionally, the techniques involved should allow you to export rich text fields that are greater than 64k in size "
The Notes rich-text structure is proprietary and you will not be able to directly export a Notes rich-text item into a Windows rich-text formatted file. It is possible to have Notes store rich text fields in HTML/MIME format (rather than the proprietary format), which you could then export to a file and attach as a .htm file as an attachment in your new software (if that would meet your requirements). If you are interested, there are some details in answers to this Stack Overflow question:
How to export Rich Text fields as HTML from Notes with LotusScript?