Modules & VBA :: Moving Rich Text From Access Memo Field To A Word Text Box
Jul 24, 2015
We need to move rich text from an Access memo field to a Word text box. So far the best Ive been able to come up with is in the code below. In this code pprs!What is a record set field of a table memo field that is bound to a text box enabled for rich text. The rich text seems to be stored as html as so I can get word to convert it by enclosing it in html tags.
Dim What As Word.Shape
Set What = doc.Shapes.AddTextbox(msoTextOrientationHorizontal , doc.PageSetup.LeftMargin, 225, 534, 0)
Dim sPath As String
sPath = "G:Temp.html"
Open sPath For Output As 1
Print #1, "<HTML>" & pprs!What & " </HTML>"
Close #1
What.TextFrame.TextRange.InsertFile (sPath)
I'm about to connect my DB to word. So I made a form where the user has to choose what entry to export. The data is inserted in a word file in different bookmarks. But there is one special task to insert the rich text so in this case the html formatted text is displayed like this:
I have an Access 2010 database with a memo field formatted for Rich Text.
I created a simple form. It accepts and shows paragraphs, i.e. I press Return and a new paragraph appears (with a blank line in between paragraphs).
I then created a report based on the same fields. In the memo field it shows the text entered in the form, but not the paragraph breaks. It just shows one big block of text without any paragraph breaks. I have looked for a field property in the report design and layout views that might affect how the text is displayed in the report but I cannot find one.
It is not much use if you can input paragraph breaks in a form but not see them in a report.
I'm trying to output some logging to a form with a Rich text textbox
This is what the form is displaying: 14:16:32: check OK: 500<10000andS235='s460'> 14:16:32: check OK: 500<10000andS235='s355'> 14:16:32: check failed:too short 500<1000231231 > 14:16:32: Ready ...
There is some coloring in the text but I'm not display that here (copy/paste of the textbox)
This is the HTML behind it (? txtbox in imm.window): 14:16:32: <font color=black>check OK: 500<10000andS235='s460'</font><br />14:16:32: <font color=black>check OK: 500<10000andS235='s355'</font><br />14:16:32: <font color=red><strong>check failed:too short 500<1000231231 </strong></font><br />14:16:32: <font color=green><strong>Ready ... </strong></font><br />
The problem is in the red > that are added to each line. I have no clue where they are coming from, in fact: they are NOT in the HTML.When I display this piece of HTML in IE I don't get the red > behind each line.I have tried to use <p> of <div> instead of <br/> but that makes no difference
I am using RTF2 ActiveX Control which enables me to include the Rict Text Controls in my Access Form.
I want to generate a doc document out of the information which i type in the RTF2 Area on the Access Form. And whatever Rich Text Format information i have written there (for eg in Bold, Italics, Indentation, Tables created, Bullets n Numbering etc), is retained as it is on the Doc document which i am generating with the help of bookmarks.
Please help in how do i do that 'coz i am not able to do it using the Rich Text Format...
I'm using Access 2010. I'm passing a string into the OpenArgs of my report - works fine. In the report there are 3 rich text fields which may contain the text I passed in, and if so I want to change the color of that text to red so it stands out.
The value passed to the report changes so I'll need to use VBA in the detail's format section to check each of the 3 rich text fields.
I have a VBA code to import mail from Lotus Notes into Access. The database user is able to read his email inside Access, similar to any email program.
Unfortunately, when I use the GetItemValue (lotusscript) method to read the body of the email message, Notes will render the Rich Text information as Plain Text, and I end up with no formatting information (bold letters, underline, text color, etc.)
How to import messages from Notes to Access and keep the text formatting? I am storing the data in a Rich Text Memo field in a table. I have found code to write HTML (MIME) messages, but not to import them into Access.
I want to create an app that works like Wikipedia. for example any word that have an explain and that's explain available in my database that word become hyperlink text with different color and so if operator click on that word open a new form and show the explain.
I had the need every so often to quickly find all instances of any (particular) word within the database, without going to the bother of thinking about where that word/subject might be in the data base, I designed a report which does the job nicely. It uses a search form/control, searches and finds all instances of the word (or words) I have asked it to find, then does a report showing all instances of whatever RTF memo fields that contain the word(s).It has to be RTF memo field because (if I wish) it goes straight into the book text I'm writing, and also it searches the book's RTF memo field. . The trouble is, at present, I then have to manually "eye scan" the resulting report to find the occurrences of the "key searched for" word, nestling/hidden somewhere within sometimes quite large chunks of text. I would love to have the report show the found "key word(s)" highlighted in (say) light blue or whatever colour, so that I can quickly & easily lock on to it visually.
I enter the word I want Access to find, into a form called "formfindword" in a text box called Text0. I click on a command box on this form, to open up the report called "Querywhatsandhowschooseword" based on a query of the same name. The query's "what" field (from the main database) has the criteria
= Like "*" and [forms]![Formfindword]![Text0] & "*"
The query's "how" field criteria (in the "or" line of the query design) is also
= Like "*" & [forms]![Formfindword]![Text0] & "*"
I have tried to use the Conditional Format facility in Report Layout view, without any luck.I think therefore that I will need some VBA code (which is totally foreign to me, unfortunately) to make this simple concept a reality.
I have a Form Display Data in my Access Database, which is working really well. However, users was asking if there is a way we can make Font Color Could/would change if The text in A field or Any field in my display form contained the word "SAD or MAD". Is there code for such thing in display form?..
I have created forms in MS Access.. Now i want to attach Rich Text Format with each of the Text Box or Text Area... How can i do that... I was trying to search for a plugin which would get attached with MS Access and then while creating the forms it would get attached with the Text Box and Text Areas..
Kindly please help me in getting a solution to this problem..
I am generating a report that needs to have a hyperlink in part of one of the fields. Prior to saving the field to the database I do a bit of VBA coding on it and add some HTML. The result is this in the field:
"There are two ways to book with your preferred rate: <br>
2. Call us directly or at 1-800-Hampton and use your Corporate ID 12345."
It works beautifully if you paste it into a web page but in the Access report, Access applies the Bold but just ignores the hyperlink.
This is Access 2013 with MS SQL Server 2008 backend. Everything I have read suggests that this should work and is supported. Is there some trick I'm missing?
I have been sending plain text emails for a while, but now I have a project where the formatting of the text needs to be specific and I need to send as rich text.
I can use the rich text from a table, excel, or word, but I am at a loss on how to get the data to Lotus Notes.
I have a process that is getting data from sharepoint page, containing 2 list. Both list contain one field I am having issues in my export, a 'Multiple Lines of Text' type field which is Rich Text in sharepoint. I have an access DB with a linked table to those 2 list. Access show the one field I am having problems with as Memo.
The Linked table pulls/display the rich text data field correctly. My access query pulls/displays the data correctly.
My export procedure does not, the cell it exports to includes the HTML Tags. How can i modify my VBA export procedure to export to excel in plain text, i dont need the same format, just want to drop the html tags.
Code: Public Sub StatusReportExport() On Error Resume Next ' Test to see if the file currently exist, if so, delete file, so new file can be written. Kill ("L:Connect SiteStatus Report " & Year(Date) & "-" & Month(Date) & "-" & Day(Date) & ".xls") If Dir("L:Connect SiteStatus Report " & Year(Date) & "-" & Month(Date) & "-" & Day(Date) & ".xls") <> "" Then MsgBox "Status Report.xls File already in use!" & vbNewLine & "Please Close File, then rerun Report."
I am close to getting code to send an email from access with the body of the email populated with a Rich Text textbox from my access form. The problem I am having is that the body of the email is converted to plain text in Outlook which is creating problems for me. How to identify what I can do to convert to rich text or HTML in Outlook? I also want to attach a table that is populated by a query in my application, but i haven't got that far yet.
In my form's text box I have noticed that I can;t write paragraphs ie use the TAB key to start a new line. If I use rich text I assume this will be possible. But are there any disadvantages to using rich text?
Hi, I have a form set up, among other fields in the form is a Weekly update free form field. I have another field called Historical Weekly updates. What I want to happen is that when a user clicks in the Weekly update field, the text that is in there should pop down to the Historical field and have the date post for the move next to the text in the historical field. I don't know if this is a click action, if its' a macro or if it's even possible. Any help would be greatly appreciated!!
Are there any other advantages in using a text field verses a memo field other than memory allocation? Memory allocation seems like such a small issue these days.
Hello everyone - what I have is a a set of default text's that I need to be able to insert into a memo field - this is how I've set it up (Access 2000)
A table with the text fields in it called wordings table comprises of Id field wordingnme (txt) wording (Memo) and I have a combo box on a form which looks up the wordingnme and hold this info - I need to have a button that will take this wordingnme and insert the wording that it relates to into the field of my record - Called Endor (memo)- I will have many text s say upto 50-60 but when I insert these into endor field I will probable only use say 5 or 6 at any one time on the record line so an example follows
line 45 in endor I wish to insert wordingnme "A" and then Wordingnme "B" I also will do some free form type within this - any idea's :eek:
Probably a really simple question, but is causing me problems! I need to be able to limit the amount of characters that can be entered into a field. For text fields I can just enter the relevant field size, but can not find an equivalent for a memo field. Validation rule warns you that there are to many characters, but doesn't seem to actually limit you.
I have a field on an Access db, this is a "Memo " type field which has many lines of text within it.
I need to run a query on this to get the last line of text within this field.
Aside from records where this memo field is filled in I also have records where the memo field is blank. So basically if the memo field is blank I want a blank field returned as well as fields with data.
I am using Access 2003 but also am running this on Access 2000 (not sure if there has been a change to function names)
This is seriously bugging me - can anyone put me out of my misery?
This is what is happening. I have created a data base that has a field that is set to be a memo field however when i linked that field to a form for entry it limits it to the 255 max characters for that the text field would have. has anyone ever come accross this problem and if so how do i over come it without starting over because the project is almost done.