Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2014, 11:58 AM
cricketicecream cricketicecream is offline vba to format html tags in a word document Windows 7 64bit vba to format html tags in a word document Office 2010 64bit
Novice
vba to format html tags in a word document
 
Join Date: Dec 2014
Posts: 1
cricketicecream is on a distinguished road
Default vba to format html tags in a word document

I'm trying to make multiple documents using mail merge and an access database, but there is one field where in Access I have it saved as rich text. I need it as rich text because it's a single field with different formatting throughout, but when I do the mail merge, it comes out as html tags.

I need a macro or something that can turn the html tags into formatted text in the word document after it is created. I'm not sure this is possible, but it needs to identify the html in the document, and cut it out replacing it as text formatted by the html tags.

The mail merge spits out something like this in the middle of an otherwise formatted document.



<div><font face="Knowledge Medium" color="#595959">Introduction (30 min.)</font></div>

<div><font color="#595959">Environment</font></div>

<div><font color="#595959">Platform</font></div>

<div>&nbsp;</div>

<div><font face="Knowledge Medium" color="#595959">Getting Started (30 min.)</font></div>

<div><font color="#595959">Overview</font></div>

<div><font color="#595959">Terms</font></div>

<div><font color="#595959">Areas</font></div>

Last edited by cricketicecream; 12-03-2014 at 12:23 PM. Reason: misspelling
Reply With Quote
  #2  
Old 12-03-2014, 03:35 PM
macropod's Avatar
macropod macropod is offline vba to format html tags in a word document Windows 7 64bit vba to format html tags in a word document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I've never seen a mailmerge that outputs tags such as you describe. Mailmerges only ever output the underlying data, respecting only the data types (dates, text, numbers, etc.) If those tags are being output by the mailmerge, that's how your data are actually stored. If you're using the Rich Text format in an endeavour to get Word to respect the formatting, don't bother. All of what you've got in those tags can be accommodated via a simple Charformat switch added to the relevant mergefields in Word and the use of plain text in your database.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and replace/insert HTML code into Master File using tags dave8555 Excel 2 02-23-2014 03:51 PM
How to use Find and Replace with HTML tags? srz92 Word 0 07-17-2013 07:55 AM
vba to format html tags in a word document Trying to wrap HTML tags around multiple different words in one operation String Word VBA 4 06-06-2013 06:23 AM
Can you actually write HTML and CSS in a word document and send it as an html page jackaroo Word 0 07-12-2010 07:49 AM
Convert a file from HTML to WORD format weblayout view gtselvam Word 0 12-02-2008 03:53 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft