A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

(Mail merge) Mergefield displays raw HTML



 
 
Thread Tools Display Modes
  #1  
Old October 18th, 2006, 09:01 AM posted to microsoft.public.word.mailmerge.fields
Søren Madsen
external usenet poster
 
Posts: 1
Default (Mail merge) Mergefield displays raw HTML

Hi,

I'm trying to insert fields which have HTML in them from an external
database - and the result is that the Mail merge fields displays the
raw HTML and white space.

Is there any way to display/treat the mergefield data as HTML? (The
HTML is very simple; just paragraphs, line breaks and strong's.)


Thanks in advance,

Søren Madsen
DK

  #2  
Old October 18th, 2006, 11:28 AM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default (Mail merge) Mergefield displays raw HTML

There's no way to do it that avoids programming of some kind.

In essence, each chunk of HTML either has to be in a disk file (so you can
insert it using INCLUDETEXT or using VBA Insertfile) or possibly in the
clipboard so you can insert it using Paste with the relevant data type.

If you are merging to the printer, to individual letters or to e-mail, I
would start with an approach that performs a separate merge for each record
in the data source. That won't work for a "Directory"/"Catalog" type of
merge. I don't have code for this specific scenario and can't guarantee
that it will work, but if you search groups.google.com for "Jamieson
bTerminateMerge" you should find VBA code that does "one merge per record"
type merges. What you then need to do is either
a. add code to save the content of your HTML format field as a .htm file
(let's call it c:\temphtm\fieldx.htm) and include it using

{ INCLUDETEXT "c:\\temphtm\\fieldx.htm" \c HTML }
or
b. (if you want to avoid saving to a disk file) insert the HTML into your
document, select it, copy it to the clipboard, locate the place(s) you want
to insert it, paste special, selecting the appropriate format

I'm away for a few days but if you are still stuck I should be able to be
more specific.

Peter Jamieson

"Søren Madsen" wrote in message
oups.com...
Hi,

I'm trying to insert fields which have HTML in them from an external
database - and the result is that the Mail merge fields displays the
raw HTML and white space.

Is there any way to display/treat the mergefield data as HTML? (The
HTML is very simple; just paragraphs, line breaks and strong's.)


Thanks in advance,

Søren Madsen
DK


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:05 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.