Hi, just looking for ideas if anyone is interested...
In Access 2013 I export certain form fields to a Word docx file which has predefined Bookmarks. This works perfectly well.
Like so:
The above works well as long as the text fields are Plain Text.
The Form(&fields) is based on a Table.
In the above example, the field txt_myFormField is a 'Long Text' (old Memo) field type.
In the table's design, the field's 'Text Format' property is set to 'Rich Text'.
Therefor, on the form, I can use text formatting features such as Bold, Underline and specifically BULLET LISTS.
Here is an example of when the field is filled in:
---------------------------
Heading in bold:
The end.
----------------------------
When this Rich Text field is "exported" to Word as in my code above, the text placed at the Word doc's Bookmark, is in PLAIN TEXT, and with HTML tags, like so: Note that it is not in HTML format, but normal plain text including the tags:
----------------------------
<div>Heading in bold:</div>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
etc.
----------------------------
To resolve this I was thinking something in the line of the following, but I'm not sure what VBA would be efective in converting html tags to Word readable format:
It is important that Word doc remains in docx format for further manual editing.
Any ideas are welcome. Please.
Thanks.
In Access 2013 I export certain form fields to a Word docx file which has predefined Bookmarks. This works perfectly well.
Like so:
Code:
'code for Dims and Strings etc
'code for defining path, docx name etc
'then this:
With myDoc
.Bookmarks("txt_myWordBookmark1").Range.InsertAfter Me.txt_myFormField
.Bookmarks("txt_myWordBookmark2").Range.InsertAfter Me.txt_myOtherField
End With
'other code
The above works well as long as the text fields are Plain Text.
The Form(&fields) is based on a Table.
In the above example, the field txt_myFormField is a 'Long Text' (old Memo) field type.
In the table's design, the field's 'Text Format' property is set to 'Rich Text'.
Therefor, on the form, I can use text formatting features such as Bold, Underline and specifically BULLET LISTS.
Here is an example of when the field is filled in:
---------------------------
Heading in bold:
- Item 1
- Item 2
- Item 3
The end.
----------------------------
When this Rich Text field is "exported" to Word as in my code above, the text placed at the Word doc's Bookmark, is in PLAIN TEXT, and with HTML tags, like so: Note that it is not in HTML format, but normal plain text including the tags:
----------------------------
<div>Heading in bold:</div>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
etc.
----------------------------
To resolve this I was thinking something in the line of the following, but I'm not sure what VBA would be efective in converting html tags to Word readable format:
Code:
.Bookmarks("txt_myWordBookmark1").Range.InsertAfter....
' then somehow Format/Convert...
...Me.txt_myFormField...
'to Word readable Rich Text
It is important that Word doc remains in docx format for further manual editing.
Any ideas are welcome. Please.
Thanks.