 |
|
 |
|
Next: Datasheet View Column Order
|
| Author |
Message |
External

Since: Mar 18, 2008 Posts: 8
|
(Msg. 1) Posted: Thu Dec 25, 2008 4:33 pm
Post subject: Access to create HTML file for WORD Archived from groups: microsoft>public>access, others (more info?)
|
|
|
Does anyone have any experience with loading a document -INTO-Word using
HTML and a cascading style sheet? All the stuff I have found in the archives
deals with exporting Word docs to HTML - I want to do the opposite.
I have an ACCESS database that does lookups and uses VBA to create a Word
document detailing the results. Initially, I had the database using a Word
template to create the document, but the process was too slow to be useful,
so I converted it to write out plain text HTML, with references to a
cascading style sheet. The results are mixed. Speed is much improved, but
Word's use of the styles I define in the CSS are hit and miss. A sample few
lines of the generated HTML text and the entire style sheet are reproduced
at the end of this post.
The basic definition, the first style, named QuarxZakladOdstavec does not
appear at all in the created Word document, unless I add some unnecessary
text specifically using that style. The subsequent definitions, which I
would like to be based on this first one are not, but are based on Normal.
Some of the graphic definitions, specifically margins, seem to be ignored
completely. The styles are affected by whatever styles are already present
in Word, in fact, they seem to take precedence over those defined in the CSS
file, and I have to run some VBA code which deletes all 'Quarx' styles
before some changes take effect. (But not all, some CSS styles do take
effect next time the HTML file is loaded, even if the old style remains.)
The Access code opens a Word template, which uses this line to load the HTML
file:
doc.Range.InsertFile FileName:="abc.htm"
if that makes any difference.
Word is capable of creating this stuff from its native files as well as
reading files in this and other formats, but my results seem almost random.
If anyone can shed some light on this, or maybe even suggest a different
approach altogether, I'd appreciate some thoughts.
Pete
=====================================================
Beginning of generated HTML text file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
<head>
<title>Class and ID Selectors</title>
<meta http-equiv="Content-Type"
content="text/xhtml;charset=windows-1250"/>
<link rel='stylesheet' type='text/css' href='C:\Users\Petr
Danes\AppData\Local\Temp\QuarxStylesheet 2008-12-16_14-29-12.css'/>
</head>
<body >
<p class='QuarxZakladOdstavec'>
ABCEDFG
<p class='QuarxHS'>
.._HS Gottaischer	[C:\Palma\T602\Hyper\A test\BATEL\BATELOV.TXT] {001}
</p>
<p class='QuarxPovel'>
..AU
</p>
<p class='QuarxAutor'>
Gottaischer
</p>
<p class='QuarxPovel'>
..TI
</p>
<p class='QuarxObycejnyText'>
Gottaischer Hofkalender fuer 1779, 1780.
</p>
<p class='QuarxPovel'>
..IM
</p>
<p class='QuarxObycejnyText'>
Goth a, s. t., 1779, 1780, 110, 175 s., 8´.
</p>
<p class='QuarxPovel'>
..RO
</p>
<p class='QuarxObycejnyText'>
</p>
<p class='QuarxPovel'>
<!--
Entire CSS file
/* Style Definitions */
/* Tohle je základ pro všechny další styly, použité pro různá označení */
p.QuarxZakladOdstavec
{mso-style-name:QuarxZakladOdstavec;
mso-style-parent:"Normal";
mso-pagination:widow-orphan;
font-size:12.0pt;
margin-top:0pt;
margin-bottom:0pt;
font-family:"Courier New";}
/* Autor, signatura a datum jsou speciálně označené, aby byly rychle vidět
*/
p.QuarxAutor
{mso-style-name:QuarxAutor;
mso-style-parent:QuarxZakladOdstavec;
font-size:12.0pt;
margin-top:0pt;
margin-bottom:0pt;
color:red;
font-weight:bold;}
p.QuarxSignatura
{mso-style-name:QuarxSignatura;
mso-style-parent:QuarxZakladOdstavec;
color:blue;
font-weight:bold;}
p.QuarxDatum
{mso-style-name:QuarxDatum;
mso-style-parent:QuarxZakladOdstavec;
color:#44BB44;
font-weight:bold;
text-decoration:underline;
text-underline:single;}
p.QuarxProvenience
{mso-style-name:QuarxProvenience;
mso-style-parent:QuarxZakladOdstavec;
font-size:12.0pt;
margin-top:0pt;
margin-bottom:0pt;
font-weight:bold;}
/* Záhlaví, označené pomocí ._HS, je barvené podle toho, jestli heslo
obsahuje nebo neobsahuje hledaný text */
p.QuarxHS
{mso-style-name:QuarxHS;
mso-style-parent:QuarxZakladOdstavec;
mso-style-next:QuarxZakladOdstavec;
page-break-before:always;
mso-border-top-alt:solid black 0.5pt;
tab-stops:right 468.0pt;
font-size:8.0pt;
margin-top:0pt;
margin-bottom:0pt;
color:#999999;}
/* Tečkové povely jsou označené tady */
p.QuarxPovel
{mso-style-name:QuarxPovel;
mso-style-parent:QuarxZakladOdstavec;
mso-style-next:QuarxZakladOdstavec;
font-size:8.0pt;
margin-top:0pt;
margin-bottom:0pt;
color:#33CCCC;
display:none;
mso-hide:all;}
/* Tečkové povely jsou označené tady */
p.QuarxObycejnyText
{mso-style-name:QuarxObycejnyText;
mso-style-parent:QuarxZakladOdstavec;
mso-style-next:QuarxPovel;
font-size:12.0pt;
margin-top:0pt;
margin-right:0pt;
margin-left:1.0cm;
margin-bottom:0pt;
font-family:"Courier New";}
/* Tady je speciální označení nalezeného textu */
span.QuarxFound
{mso-style-name:QuarxFound;
background:pink;}
span.QuarxNalezenyText
{mso-style-name:QuarxNalezenyText;
background:yellow;
border:1px solid lime;}
--
This e-mail address is fake, to keep spammers and their address harvesters
out
of my hair. If you want to get in touch personally, I am 'pdanes' and I use
yahoo mail. But please use the newsgroup when possible, so that all may
benefit from the exchange of ideas. >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Mar 08, 2008 Posts: 210
|
(Msg. 2) Posted: Thu Dec 25, 2008 4:33 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
I think you might do better in a word newsgroup. You seem to be quite
fluent in sending the html you want to word but making it format would be
more on the word side than the Access side. I have issues getting what I
want in HTML and style sheets even when doing it directly in word. Just my
thoughts. Pete
"Petr Danes" wrote in message
> Does anyone have any experience with loading a document -INTO-Word using
> HTML and a cascading style sheet? All the stuff I have found in the
> archives deals with exporting Word docs to HTML - I want to do the
> opposite.
>
> I have an ACCESS database that does lookups and uses VBA to create a Word
> document detailing the results. Initially, I had the database using a Word
> template to create the document, but the process was too slow to be
> useful, so I converted it to write out plain text HTML, with references to
> a cascading style sheet. The results are mixed. Speed is much improved,
> but Word's use of the styles I define in the CSS are hit and miss. A
> sample few lines of the generated HTML text and the entire style sheet are
> reproduced at the end of this post.
>
> The basic definition, the first style, named QuarxZakladOdstavec does not
> appear at all in the created Word document, unless I add some unnecessary
> text specifically using that style. The subsequent definitions, which I
> would like to be based on this first one are not, but are based on Normal.
> Some of the graphic definitions, specifically margins, seem to be ignored
> completely. The styles are affected by whatever styles are already present
> in Word, in fact, they seem to take precedence over those defined in the
> CSS file, and I have to run some VBA code which deletes all 'Quarx' styles
> before some changes take effect. (But not all, some CSS styles do take
> effect next time the HTML file is loaded, even if the old style remains.)
> The Access code opens a Word template, which uses this line to load the
> HTML file:
> doc.Range.InsertFile FileName:="abc.htm"
> if that makes any difference.
>
> Word is capable of creating this stuff from its native files as well as
> reading files in this and other formats, but my results seem almost
> random. If anyone can shed some light on this, or maybe even suggest a
> different approach altogether, I'd appreciate some thoughts.
>
> Pete
>
>
>
> =====================================================
> Beginning of generated HTML text file:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
> <head>
> <title>Class and ID Selectors</title>
> <meta http-equiv="Content-Type"
> content="text/xhtml;charset=windows-1250"/>
> <link rel='stylesheet' type='text/css' href='C:\Users\Petr
> Danes\AppData\Local\Temp\QuarxStylesheet 2008-12-16_14-29-12.css'/>
> </head>
> <body >
> <p class='QuarxZakladOdstavec'>
> ABCEDFG
> <p class='QuarxHS'>
> ._HS Gottaischer	[C:\Palma\T602\Hyper\A test\BATEL\BATELOV.TXT]
> {001}
> </p>
> <p class='QuarxPovel'>
> .AU
> </p>
> <p class='QuarxAutor'>
> Gottaischer
> </p>
> <p class='QuarxPovel'>
> .TI
> </p>
> <p class='QuarxObycejnyText'>
> Gottaischer Hofkalender fuer 1779, 1780.
> </p>
> <p class='QuarxPovel'>
> .IM
> </p>
> <p class='QuarxObycejnyText'>
> Goth a, s. t., 1779, 1780, 110, 175 s., 8´.
> </p>
> <p class='QuarxPovel'>
> .RO
> </p>
> <p class='QuarxObycejnyText'>
>
> </p>
> <p class='QuarxPovel'>
>
> <!--
>
>
>
> Entire CSS file
>
> /* Style Definitions */
>
> /* Tohle je základ pro všechny další styly, použité pro různá označení */
>
> p.QuarxZakladOdstavec
> {mso-style-name:QuarxZakladOdstavec;
> mso-style-parent:"Normal";
> mso-pagination:widow-orphan;
> font-size:12.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> font-family:"Courier New";}
>
> /* Autor, signatura a datum jsou speciálně označené, aby byly rychle vidět
> */
>
> p.QuarxAutor
> {mso-style-name:QuarxAutor;
> mso-style-parent:QuarxZakladOdstavec;
> font-size:12.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> color:red;
> font-weight:bold;}
> p.QuarxSignatura
> {mso-style-name:QuarxSignatura;
> mso-style-parent:QuarxZakladOdstavec;
> color:blue;
> font-weight:bold;}
> p.QuarxDatum
> {mso-style-name:QuarxDatum;
> mso-style-parent:QuarxZakladOdstavec;
> color:#44BB44;
> font-weight:bold;
> text-decoration:underline;
> text-underline:single;}
> p.QuarxProvenience
> {mso-style-name:QuarxProvenience;
> mso-style-parent:QuarxZakladOdstavec;
> font-size:12.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> font-weight:bold;}
>
> /* Záhlaví, označené pomocí ._HS, je barvené podle toho, jestli heslo
> obsahuje nebo neobsahuje hledaný text */
>
> p.QuarxHS
> {mso-style-name:QuarxHS;
> mso-style-parent:QuarxZakladOdstavec;
> mso-style-next:QuarxZakladOdstavec;
> page-break-before:always;
> mso-border-top-alt:solid black 0.5pt;
> tab-stops:right 468.0pt;
> font-size:8.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> color:#999999;}
>
>
> /* Tečkové povely jsou označené tady */
>
> p.QuarxPovel
> {mso-style-name:QuarxPovel;
> mso-style-parent:QuarxZakladOdstavec;
> mso-style-next:QuarxZakladOdstavec;
> font-size:8.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> color:#33CCCC;
> display:none;
> mso-hide:all;}
>
>
> /* Tečkové povely jsou označené tady */
> p.QuarxObycejnyText
> {mso-style-name:QuarxObycejnyText;
> mso-style-parent:QuarxZakladOdstavec;
> mso-style-next:QuarxPovel;
> font-size:12.0pt;
> margin-top:0pt;
> margin-right:0pt;
> margin-left:1.0cm;
> margin-bottom:0pt;
> font-family:"Courier New";}
>
>
> /* Tady je speciální označení nalezeného textu */
>
> span.QuarxFound
> {mso-style-name:QuarxFound;
> background:pink;}
>
> span.QuarxNalezenyText
> {mso-style-name:QuarxNalezenyText;
> background:yellow;
> border:1px solid lime;}
>
>
>
> --
> This e-mail address is fake, to keep spammers and their address harvesters
> out
> of my hair. If you want to get in touch personally, I am 'pdanes' and I
> use
> yahoo mail. But please use the newsgroup when possible, so that all may
> benefit from the exchange of ideas.
>
> >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Mar 18, 2008 Posts: 8
|
(Msg. 3) Posted: Thu Dec 25, 2008 5:36 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Yes, I posted it to both a Word programming group as well as this Access
group, since a lot of Access freaks know quite a bit about the entire Office
package and its various interactions. Also, they often have good ideas about
how to restructure the entire setup to completely avoid a problem, rather
than concocting some laborious process to solve it.
Pete
"Pete D." píše v diskusním příspěvku
>I think you might do better in a word newsgroup. You seem to be quite
>fluent in sending the html you want to word but making it format would be
>more on the word side than the Access side. I have issues getting what I
>want in HTML and style sheets even when doing it directly in word. Just my
>thoughts. Pete
>
> "Petr Danes" wrote in message
>
>> Does anyone have any experience with loading a document -INTO-Word using
>> HTML and a cascading style sheet? All the stuff I have found in the
>> archives deals with exporting Word docs to HTML - I want to do the
>> opposite.
>>
>> I have an ACCESS database that does lookups and uses VBA to create a Word
>> document detailing the results. Initially, I had the database using a
>> Word template to create the document, but the process was too slow to be
>> useful, so I converted it to write out plain text HTML, with references
>> to a cascading style sheet. The results are mixed. Speed is much
>> improved, but Word's use of the styles I define in the CSS are hit and
>> miss. A sample few lines of the generated HTML text and the entire style
>> sheet are reproduced at the end of this post.
>>
>> The basic definition, the first style, named QuarxZakladOdstavec does not
>> appear at all in the created Word document, unless I add some unnecessary
>> text specifically using that style. The subsequent definitions, which I
>> would like to be based on this first one are not, but are based on
>> Normal. Some of the graphic definitions, specifically margins, seem to be
>> ignored completely. The styles are affected by whatever styles are
>> already present in Word, in fact, they seem to take precedence over those
>> defined in the CSS file, and I have to run some VBA code which deletes
>> all 'Quarx' styles before some changes take effect. (But not all, some
>> CSS styles do take effect next time the HTML file is loaded, even if the
>> old style remains.) The Access code opens a Word template, which uses
>> this line to load the HTML file:
>> doc.Range.InsertFile FileName:="abc.htm"
>> if that makes any difference.
>>
>> Word is capable of creating this stuff from its native files as well as
>> reading files in this and other formats, but my results seem almost
>> random. If anyone can shed some light on this, or maybe even suggest a
>> different approach altogether, I'd appreciate some thoughts.
>>
>> Pete
>>
>>
>>
>> =====================================================
>> Beginning of generated HTML text file:
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>> <head>
>> <title>Class and ID Selectors</title>
>> <meta http-equiv="Content-Type"
>> content="text/xhtml;charset=windows-1250"/>
>> <link rel='stylesheet' type='text/css' href='C:\Users\Petr
>> Danes\AppData\Local\Temp\QuarxStylesheet 2008-12-16_14-29-12.css'/>
>> </head>
>> <body >
>> <p class='QuarxZakladOdstavec'>
>> ABCEDFG
>> <p class='QuarxHS'>
>> ._HS Gottaischer	[C:\Palma\T602\Hyper\A test\BATEL\BATELOV.TXT]
>> {001}
>> </p>
>> <p class='QuarxPovel'>
>> .AU
>> </p>
>> <p class='QuarxAutor'>
>> Gottaischer
>> </p>
>> <p class='QuarxPovel'>
>> .TI
>> </p>
>> <p class='QuarxObycejnyText'>
>> Gottaischer Hofkalender fuer 1779, 1780.
>> </p>
>> <p class='QuarxPovel'>
>> .IM
>> </p>
>> <p class='QuarxObycejnyText'>
>> Goth a, s. t., 1779, 1780, 110, 175 s., 8´.
>> </p>
>> <p class='QuarxPovel'>
>> .RO
>> </p>
>> <p class='QuarxObycejnyText'>
>>
>> </p>
>> <p class='QuarxPovel'>
>>
>> <!--
>>
>>
>>
>> Entire CSS file
>>
>> /* Style Definitions */
>>
>> /* Tohle je základ pro všechny další styly, použité pro různá označení */
>>
>> p.QuarxZakladOdstavec
>> {mso-style-name:QuarxZakladOdstavec;
>> mso-style-parent:"Normal";
>> mso-pagination:widow-orphan;
>> font-size:12.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> font-family:"Courier New";}
>>
>> /* Autor, signatura a datum jsou speciálně označené, aby byly rychle
>> vidět */
>>
>> p.QuarxAutor
>> {mso-style-name:QuarxAutor;
>> mso-style-parent:QuarxZakladOdstavec;
>> font-size:12.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> color:red;
>> font-weight:bold;}
>> p.QuarxSignatura
>> {mso-style-name:QuarxSignatura;
>> mso-style-parent:QuarxZakladOdstavec;
>> color:blue;
>> font-weight:bold;}
>> p.QuarxDatum
>> {mso-style-name:QuarxDatum;
>> mso-style-parent:QuarxZakladOdstavec;
>> color:#44BB44;
>> font-weight:bold;
>> text-decoration:underline;
>> text-underline:single;}
>> p.QuarxProvenience
>> {mso-style-name:QuarxProvenience;
>> mso-style-parent:QuarxZakladOdstavec;
>> font-size:12.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> font-weight:bold;}
>>
>> /* Záhlaví, označené pomocí ._HS, je barvené podle toho, jestli heslo
>> obsahuje nebo neobsahuje hledaný text */
>>
>> p.QuarxHS
>> {mso-style-name:QuarxHS;
>> mso-style-parent:QuarxZakladOdstavec;
>> mso-style-next:QuarxZakladOdstavec;
>> page-break-before:always;
>> mso-border-top-alt:solid black 0.5pt;
>> tab-stops:right 468.0pt;
>> font-size:8.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> color:#999999;}
>>
>>
>> /* Tečkové povely jsou označené tady */
>>
>> p.QuarxPovel
>> {mso-style-name:QuarxPovel;
>> mso-style-parent:QuarxZakladOdstavec;
>> mso-style-next:QuarxZakladOdstavec;
>> font-size:8.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> color:#33CCCC;
>> display:none;
>> mso-hide:all;}
>>
>>
>> /* Tečkové povely jsou označené tady */
>> p.QuarxObycejnyText
>> {mso-style-name:QuarxObycejnyText;
>> mso-style-parent:QuarxZakladOdstavec;
>> mso-style-next:QuarxPovel;
>> font-size:12.0pt;
>> margin-top:0pt;
>> margin-right:0pt;
>> margin-left:1.0cm;
>> margin-bottom:0pt;
>> font-family:"Courier New";}
>>
>>
>> /* Tady je speciální označení nalezeného textu */
>>
>> span.QuarxFound
>> {mso-style-name:QuarxFound;
>> background:pink;}
>>
>> span.QuarxNalezenyText
>> {mso-style-name:QuarxNalezenyText;
>> background:yellow;
>> border:1px solid lime;}
>>
>>
>>
>> --
>> This e-mail address is fake, to keep spammers and their address
>> harvesters out
>> of my hair. If you want to get in touch personally, I am 'pdanes' and I
>> use
>> yahoo mail. But please use the newsgroup when possible, so that all may
>> benefit from the exchange of ideas.
>>
>>
>
> >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Dec 13, 2003 Posts: 301
|
(Msg. 4) Posted: Fri Dec 26, 2008 3:21 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Instead of using Range.InsertFile, maybe you should open the HTML document
as an independant word document and then transfert it to the real document.
For an example, see:
http://www.bokebb.com/dev/english/1990/posts/199082985.shtml
Also, this example is about using a RTF document instead of using HTML;
maybe you should do the same and use RTF instead of HTML. I won't be
surprisde if you have a better control over your RTF documents than over an
HTML document.
References on RTF:
http://en.wikipedia.org/wiki/Rich_Text_Format
http://www.microsoft.com/downloadS/details.aspx?familyid=DD422B8D-FF06...07-B476
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txt...eId=692
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Petr Danes" wrote in message
> Does anyone have any experience with loading a document -INTO-Word using
> HTML and a cascading style sheet? All the stuff I have found in the
> archives deals with exporting Word docs to HTML - I want to do the
> opposite.
>
> I have an ACCESS database that does lookups and uses VBA to create a Word
> document detailing the results. Initially, I had the database using a Word
> template to create the document, but the process was too slow to be
> useful, so I converted it to write out plain text HTML, with references to
> a cascading style sheet. The results are mixed. Speed is much improved,
> but Word's use of the styles I define in the CSS are hit and miss. A
> sample few lines of the generated HTML text and the entire style sheet are
> reproduced at the end of this post.
>
> The basic definition, the first style, named QuarxZakladOdstavec does not
> appear at all in the created Word document, unless I add some unnecessary
> text specifically using that style. The subsequent definitions, which I
> would like to be based on this first one are not, but are based on Normal.
> Some of the graphic definitions, specifically margins, seem to be ignored
> completely. The styles are affected by whatever styles are already present
> in Word, in fact, they seem to take precedence over those defined in the
> CSS file, and I have to run some VBA code which deletes all 'Quarx' styles
> before some changes take effect. (But not all, some CSS styles do take
> effect next time the HTML file is loaded, even if the old style remains.)
> The Access code opens a Word template, which uses this line to load the
> HTML file:
> doc.Range.InsertFile FileName:="abc.htm"
> if that makes any difference.
>
> Word is capable of creating this stuff from its native files as well as
> reading files in this and other formats, but my results seem almost
> random. If anyone can shed some light on this, or maybe even suggest a
> different approach altogether, I'd appreciate some thoughts.
>
> Pete
>
>
>
> =====================================================
> Beginning of generated HTML text file:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
> <head>
> <title>Class and ID Selectors</title>
> <meta http-equiv="Content-Type"
> content="text/xhtml;charset=windows-1250"/>
> <link rel='stylesheet' type='text/css' href='C:\Users\Petr
> Danes\AppData\Local\Temp\QuarxStylesheet 2008-12-16_14-29-12.css'/>
> </head>
> <body >
> <p class='QuarxZakladOdstavec'>
> ABCEDFG
> <p class='QuarxHS'>
> ._HS Gottaischer	[C:\Palma\T602\Hyper\A test\BATEL\BATELOV.TXT]
> {001}
> </p>
> <p class='QuarxPovel'>
> .AU
> </p>
> <p class='QuarxAutor'>
> Gottaischer
> </p>
> <p class='QuarxPovel'>
> .TI
> </p>
> <p class='QuarxObycejnyText'>
> Gottaischer Hofkalender fuer 1779, 1780.
> </p>
> <p class='QuarxPovel'>
> .IM
> </p>
> <p class='QuarxObycejnyText'>
> Goth a, s. t., 1779, 1780, 110, 175 s., 8´.
> </p>
> <p class='QuarxPovel'>
> .RO
> </p>
> <p class='QuarxObycejnyText'>
>
> </p>
> <p class='QuarxPovel'>
>
> <!--
>
>
>
> Entire CSS file
>
> /* Style Definitions */
>
> /* Tohle je základ pro všechny další styly, použité pro různá označení */
>
> p.QuarxZakladOdstavec
> {mso-style-name:QuarxZakladOdstavec;
> mso-style-parent:"Normal";
> mso-pagination:widow-orphan;
> font-size:12.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> font-family:"Courier New";}
>
> /* Autor, signatura a datum jsou speciálně označené, aby byly rychle vidět
> */
>
> p.QuarxAutor
> {mso-style-name:QuarxAutor;
> mso-style-parent:QuarxZakladOdstavec;
> font-size:12.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> color:red;
> font-weight:bold;}
> p.QuarxSignatura
> {mso-style-name:QuarxSignatura;
> mso-style-parent:QuarxZakladOdstavec;
> color:blue;
> font-weight:bold;}
> p.QuarxDatum
> {mso-style-name:QuarxDatum;
> mso-style-parent:QuarxZakladOdstavec;
> color:#44BB44;
> font-weight:bold;
> text-decoration:underline;
> text-underline:single;}
> p.QuarxProvenience
> {mso-style-name:QuarxProvenience;
> mso-style-parent:QuarxZakladOdstavec;
> font-size:12.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> font-weight:bold;}
>
> /* Záhlaví, označené pomocí ._HS, je barvené podle toho, jestli heslo
> obsahuje nebo neobsahuje hledaný text */
>
> p.QuarxHS
> {mso-style-name:QuarxHS;
> mso-style-parent:QuarxZakladOdstavec;
> mso-style-next:QuarxZakladOdstavec;
> page-break-before:always;
> mso-border-top-alt:solid black 0.5pt;
> tab-stops:right 468.0pt;
> font-size:8.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> color:#999999;}
>
>
> /* Tečkové povely jsou označené tady */
>
> p.QuarxPovel
> {mso-style-name:QuarxPovel;
> mso-style-parent:QuarxZakladOdstavec;
> mso-style-next:QuarxZakladOdstavec;
> font-size:8.0pt;
> margin-top:0pt;
> margin-bottom:0pt;
> color:#33CCCC;
> display:none;
> mso-hide:all;}
>
>
> /* Tečkové povely jsou označené tady */
> p.QuarxObycejnyText
> {mso-style-name:QuarxObycejnyText;
> mso-style-parent:QuarxZakladOdstavec;
> mso-style-next:QuarxPovel;
> font-size:12.0pt;
> margin-top:0pt;
> margin-right:0pt;
> margin-left:1.0cm;
> margin-bottom:0pt;
> font-family:"Courier New";}
>
>
> /* Tady je speciální označení nalezeného textu */
>
> span.QuarxFound
> {mso-style-name:QuarxFound;
> background:pink;}
>
> span.QuarxNalezenyText
> {mso-style-name:QuarxNalezenyText;
> background:yellow;
> border:1px solid lime;}
>
>
>
> --
> This e-mail address is fake, to keep spammers and their address harvesters
> out
> of my hair. If you want to get in touch personally, I am 'pdanes' and I
> use
> yahoo mail. But please use the newsgroup when possible, so that all may
> benefit from the exchange of ideas.
>
> >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Mar 18, 2008 Posts: 8
|
(Msg. 5) Posted: Sat Dec 27, 2008 7:25 am
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hm, hadn't thought of the RTF path. I'll have to study the specs and see if
it can do everything I need. It looks promising, I had no idea that RTF was
such a capable format. Including all the formatting inline may bulk the file
a bit, but I'll give it a try.
Still, the CSS/HTML route should work as well. Any ideas why it's giving me
so much trouble?
As for the Range.InsertFile, I forget now exactly why I did it that way,
rather than simply opening a file, but there was a reason. I think maybe it
was because the Open command opens a new document each time it is called,
causing them to pile up when doing multiple searches.
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)> píše
v diskusním příspěvku
> Instead of using Range.InsertFile, maybe you should open the HTML document
> as an independant word document and then transfert it to the real
> document. For an example, see:
>
> http://www.bokebb.com/dev/english/1990/posts/199082985.shtml
>
> Also, this example is about using a RTF document instead of using HTML;
> maybe you should do the same and use RTF instead of HTML. I won't be
> surprisde if you have a better control over your RTF documents than over
> an HTML document.
>
> References on RTF:
>
> http://en.wikipedia.org/wiki/Rich_Text_Format
>
> http://www.microsoft.com/downloadS/details.aspx?familyid=DD422B8D-FF06...07-B476
>
> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txt...eId=692
>
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: sylvain aei ca (fill the blanks, no spam please)
>
>
> "Petr Danes" wrote in message
>
>> Does anyone have any experience with loading a document -INTO-Word using
>> HTML and a cascading style sheet? All the stuff I have found in the
>> archives deals with exporting Word docs to HTML - I want to do the
>> opposite.
>>
>> I have an ACCESS database that does lookups and uses VBA to create a Word
>> document detailing the results. Initially, I had the database using a
>> Word template to create the document, but the process was too slow to be
>> useful, so I converted it to write out plain text HTML, with references
>> to a cascading style sheet. The results are mixed. Speed is much
>> improved, but Word's use of the styles I define in the CSS are hit and
>> miss. A sample few lines of the generated HTML text and the entire style
>> sheet are reproduced at the end of this post.
>>
>> The basic definition, the first style, named QuarxZakladOdstavec does not
>> appear at all in the created Word document, unless I add some unnecessary
>> text specifically using that style. The subsequent definitions, which I
>> would like to be based on this first one are not, but are based on
>> Normal. Some of the graphic definitions, specifically margins, seem to be
>> ignored completely. The styles are affected by whatever styles are
>> already present in Word, in fact, they seem to take precedence over those
>> defined in the CSS file, and I have to run some VBA code which deletes
>> all 'Quarx' styles before some changes take effect. (But not all, some
>> CSS styles do take effect next time the HTML file is loaded, even if the
>> old style remains.) The Access code opens a Word template, which uses
>> this line to load the HTML file:
>> doc.Range.InsertFile FileName:="abc.htm"
>> if that makes any difference.
>>
>> Word is capable of creating this stuff from its native files as well as
>> reading files in this and other formats, but my results seem almost
>> random. If anyone can shed some light on this, or maybe even suggest a
>> different approach altogether, I'd appreciate some thoughts.
>>
>> Pete
>>
>>
>>
>> =====================================================
>> Beginning of generated HTML text file:
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>> <head>
>> <title>Class and ID Selectors</title>
>> <meta http-equiv="Content-Type"
>> content="text/xhtml;charset=windows-1250"/>
>> <link rel='stylesheet' type='text/css' href='C:\Users\Petr
>> Danes\AppData\Local\Temp\QuarxStylesheet 2008-12-16_14-29-12.css'/>
>> </head>
>> <body >
>> <p class='QuarxZakladOdstavec'>
>> ABCEDFG
>> <p class='QuarxHS'>
>> ._HS Gottaischer	[C:\Palma\T602\Hyper\A test\BATEL\BATELOV.TXT]
>> {001}
>> </p>
>> <p class='QuarxPovel'>
>> .AU
>> </p>
>> <p class='QuarxAutor'>
>> Gottaischer
>> </p>
>> <p class='QuarxPovel'>
>> .TI
>> </p>
>> <p class='QuarxObycejnyText'>
>> Gottaischer Hofkalender fuer 1779, 1780.
>> </p>
>> <p class='QuarxPovel'>
>> .IM
>> </p>
>> <p class='QuarxObycejnyText'>
>> Goth a, s. t., 1779, 1780, 110, 175 s., 8´.
>> </p>
>> <p class='QuarxPovel'>
>> .RO
>> </p>
>> <p class='QuarxObycejnyText'>
>>
>> </p>
>> <p class='QuarxPovel'>
>>
>> <!--
>>
>>
>>
>> Entire CSS file
>>
>> /* Style Definitions */
>>
>> /* Tohle je základ pro všechny další styly, použité pro různá označení */
>>
>> p.QuarxZakladOdstavec
>> {mso-style-name:QuarxZakladOdstavec;
>> mso-style-parent:"Normal";
>> mso-pagination:widow-orphan;
>> font-size:12.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> font-family:"Courier New";}
>>
>> /* Autor, signatura a datum jsou speciálně označené, aby byly rychle
>> vidět */
>>
>> p.QuarxAutor
>> {mso-style-name:QuarxAutor;
>> mso-style-parent:QuarxZakladOdstavec;
>> font-size:12.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> color:red;
>> font-weight:bold;}
>> p.QuarxSignatura
>> {mso-style-name:QuarxSignatura;
>> mso-style-parent:QuarxZakladOdstavec;
>> color:blue;
>> font-weight:bold;}
>> p.QuarxDatum
>> {mso-style-name:QuarxDatum;
>> mso-style-parent:QuarxZakladOdstavec;
>> color:#44BB44;
>> font-weight:bold;
>> text-decoration:underline;
>> text-underline:single;}
>> p.QuarxProvenience
>> {mso-style-name:QuarxProvenience;
>> mso-style-parent:QuarxZakladOdstavec;
>> font-size:12.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> font-weight:bold;}
>>
>> /* Záhlaví, označené pomocí ._HS, je barvené podle toho, jestli heslo
>> obsahuje nebo neobsahuje hledaný text */
>>
>> p.QuarxHS
>> {mso-style-name:QuarxHS;
>> mso-style-parent:QuarxZakladOdstavec;
>> mso-style-next:QuarxZakladOdstavec;
>> page-break-before:always;
>> mso-border-top-alt:solid black 0.5pt;
>> tab-stops:right 468.0pt;
>> font-size:8.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> color:#999999;}
>>
>>
>> /* Tečkové povely jsou označené tady */
>>
>> p.QuarxPovel
>> {mso-style-name:QuarxPovel;
>> mso-style-parent:QuarxZakladOdstavec;
>> mso-style-next:QuarxZakladOdstavec;
>> font-size:8.0pt;
>> margin-top:0pt;
>> margin-bottom:0pt;
>> color:#33CCCC;
>> display:none;
>> mso-hide:all;}
>>
>>
>> /* Tečkové povely jsou označené tady */
>> p.QuarxObycejnyText
>> {mso-style-name:QuarxObycejnyText;
>> mso-style-parent:QuarxZakladOdstavec;
>> mso-style-next:QuarxPovel;
>> font-size:12.0pt;
>> margin-top:0pt;
>> margin-right:0pt;
>> margin-left:1.0cm;
>> margin-bottom:0pt;
>> font-family:"Courier New";}
>>
>>
>> /* Tady je speciální označení nalezeného textu */
>>
>> span.QuarxFound
>> {mso-style-name:QuarxFound;
>> background:pink;}
>>
>> span.QuarxNalezenyText
>> {mso-style-name:QuarxNalezenyText;
>> background:yellow;
>> border:1px solid lime;}
>>
>>
>>
>> --
>> This e-mail address is fake, to keep spammers and their address
>> harvesters out
>> of my hair. If you want to get in touch personally, I am 'pdanes' and I
>> use
>> yahoo mail. But please use the newsgroup when possible, so that all may
>> benefit from the exchange of ideas.
>>
>>
>
> >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Apr 09, 2008 Posts: 457
|
(Msg. 6) Posted: Sat Dec 27, 2008 8:57 am
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
----------------------------------------------------------------------------------------
Access, however, is not perfect. Performance degrades significantly as
the database size increases. The database is also prone to corruption.
Finally, starting with an Access database has tempted many developers
to do a dangerous thing. Sometimes a single-user application becomes
popular enough that there's a desire for it to be used by multiple
simultaneous users. The temptation is to just move the Access database
file to a network share, copy the application to multiple machines,
and let many users connect simultaneously. Access performance drops
off quickly with multiple users, and it's highly unlikely that an
application that was designed for a single user will work reliably
with concurrent users.
http://msdn.microsoft.com/en-us/library/aa730870(VS.80).aspx
----------------------------------------------------------------------------------------
On Dec 27, 4:04 am, "Petr Danes" wrote:
> Hm, hadn't thought of the RTF path. I'll have to study the specs and see if
> it can do everything I need. It looks promising, I had no idea that RTF was
> such a capable format. Including all the formatting inline may bulk the file
> a bit, but I'll give it a try.
>
> Still, the CSS/HTML route should work as well. Any ideas why it's giving me
> so much trouble?
>
> As for the Range.InsertFile, I forget now exactly why I did it that way,
> rather than simply opening a file, but there was a reason. I think maybe it
> was because the Open command opens a new document each time it is called,
> causing them to pile up when doing multiple searches.
>
> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)> píše
> v diskusním příspěvkunews:ebQqNe5ZJHA.4520@TK2MSFTNGP06.phx.gbl....
>
>
>
> > Instead of using Range.InsertFile, maybe you should open the HTML document
> > as an independant word document and then transfert it to the real
> > document. For an example, see:
>
> >http://www.bokebb.com/dev/english/1990/posts/199082985.shtml
>
> > Also, this example is about using a RTF document instead of using HTML;
> > maybe you should do the same and use RTF instead of HTML. I won't be
> > surprisde if you have a better control over your RTF documents than over
> > an HTML document.
>
> > References on RTF:
>
> >http://en.wikipedia.org/wiki/Rich_Text_Format
>
> >http://www.microsoft.com/downloadS/details.aspx?familyid=DD422B8D-FF0....
>
> >http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&tx....
>
> > --
> > Sylvain Lafontaine, ing.
> > MVP - Technologies Virtual-PC
> > E-mail: sylvain aei ca (fill the blanks, no spam please)
>
> > "Petr Danes" wrote in message
> >
> >> Does anyone have any experience with loading a document -INTO-Word using
> >> HTML and a cascading style sheet? All the stuff I have found in the
> >> archives deals with exporting Word docs to HTML - I want to do the
> >> opposite.
>
> >> I have an ACCESS database that does lookups and uses VBA to create a Word
> >> document detailing the results. Initially, I had the database using a
> >> Word template to create the document, but the process was too slow to be
> >> useful, so I converted it to write out plain text HTML, with references
> >> to a cascading style sheet. The results are mixed.Speedis much
> >> improved, but Word's use of the styles I define in the CSS are hit and
> >> miss. A sample few lines of the generated HTML text and the entire style
> >> sheet are reproduced at the end of this post.
>
> >> The basic definition, the first style, named QuarxZakladOdstavec does not
> >> appear at all in the created Word document, unless I add some unnecessary
> >> text specifically using that style. The subsequent definitions, which I
> >> would like to be based on this first one are not, but are based on
> >> Normal. Some of the graphic definitions, specifically margins, seem to be
> >> ignored completely. The styles are affected by whatever styles are
> >> already present in Word, in fact, they seem to take precedence over those
> >> defined in the CSS file, and I have to run some VBA code which deletes
> >> all 'Quarx' styles before some changes take effect. (But not all, some
> >> CSS styles do take effect next time the HTML file is loaded, even if the
> >> old style remains.) The Access code opens a Word template, which uses
> >> this line to load the HTML file:
> >> doc.Range.InsertFile FileName:="abc.htm"
> >> if that makes any difference.
>
> >> Word is capable of creating this stuff from its native files as well as
> >> reading files in this and other formats, but my results seem almost
> >> random. If anyone can shed some light on this, or maybe even suggest a
> >> different approach altogether, I'd appreciate some thoughts.
>
> >> Pete
>
> >> =====================================================
> >> Beginning of generated HTML text file:
>
> >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
> >> <head>
> >> <title>Class and ID Selectors</title>
> >> <meta http-equiv="Content-Type"
> >> content="text/xhtml;charset=windows-1250"/>
> >> <link rel='stylesheet' type='text/css' href='C:\Users\Petr
> >> Danes\AppData\Local\Temp\QuarxStylesheet 2008-12-16_14-29-12.css'/>
> >> </head>
> >> <body >
> >> <p class='QuarxZakladOdstavec'>
> >> ABCEDFG
> >> <p class='QuarxHS'>
> >> ._HS Gottaischer	[C:\Palma\T602\Hyper\A test\BATEL\BATELOV.TXT]
> >> {001}
> >> </p>
> >> <p class='QuarxPovel'>
> >> .AU
> >> </p>
> >> <p class='QuarxAutor'>
> >> Gottaischer
> >> </p>
> >> <p class='QuarxPovel'>
> >> .TI
> >> </p>
> >> <p class='QuarxObycejnyText'>
> >> Gottaischer Hofkalender fuer 1779, 1780.
> >> </p>
> >> <p class='QuarxPovel'>
> >> .IM
> >> </p>
> >> <p class='QuarxObycejnyText'>
> >> Goth a, s. t., 1779, 1780, 110, 175 s., 8´.
> >> </p>
> >> <p class='QuarxPovel'>
> >> .RO
> >> </p>
> >> <p class='QuarxObycejnyText'>
>
> >> </p>
> >> <p class='QuarxPovel'>
>
> >> <!--
>
> >> Entire CSS file
>
> >> /* Style Definitions */
>
> >> /* Tohle je základ pro všechny další styly, použité pro různá označení */
>
> >> p.QuarxZakladOdstavec
> >> {mso-style-name:QuarxZakladOdstavec;
> >> mso-style-parent:"Normal";
> >> mso-pagination:widow-orphan;
> >> font-size:12.0pt;
> >> margin-top:0pt;
> >> margin-bottom:0pt;
> >> font-family:"Courier New";}
>
> >> /* Autor, signatura a datum jsou speciálně označené, aby byly rychle
> >> vidět */
>
> >> p.QuarxAutor
> >> {mso-style-name:QuarxAutor;
> >> mso-style-parent:QuarxZakladOdstavec;
> >> font-size:12.0pt;
> >> margin-top:0pt;
> >> margin-bottom:0pt;
> >> color:red;
> >> font-weight:bold;}
> >> p.QuarxSignatura
> >> {mso-style-name:QuarxSignatura;
> >> mso-style-parent:QuarxZakladOdstavec;
> >> color:blue;
> >> font-weight:bold;}
> >> p.QuarxDatum
> >> {mso-style-name:QuarxDatum;
> >> mso-style-parent:QuarxZakladOdstavec;
> >> color:#44BB44;
> >> font-weight:bold;
> >> text-decoration:underline;
> >> text-underline:single;}
> >> p.QuarxProvenience
> >> {mso-style-name:QuarxProvenience;
> >> mso-style-parent:QuarxZakladOdstavec;
> >> font-size:12.0pt;
> >> margin-top:0pt;
> >> margin-bottom:0pt;
> >> font-weight:bold;}
>
> >> /* Záhlaví, označené pomocí ._HS, je barvené podle toho, jestli heslo
> >> obsahuje nebo neobsahuje hledaný text */
>
> >> p.QuarxHS
> >> {mso-style-name:QuarxHS;
> >> mso-style-parent:QuarxZakladOdstavec;
> >> mso-style-next:QuarxZakladOdstavec;
> >> page-break-before:always;
> >> mso-border-top-alt:solid black 0.5pt;
> >> tab-stops:right 468.0pt;
> >> font-size:8.0pt;
> >> margin-top:0pt;
> >> margin-bottom:0pt;
> >> color:#999999;}
>
> >> /* Tečkové povely jsou označené tady */
>
> >> p.QuarxPovel
> >> {mso-style-name:QuarxPovel;
> >> mso-style-parent:QuarxZakladOdstavec;
> >> mso-style-next:QuarxZakladOdstavec;
> >> font-size:8.0pt;
> >> margin-top:0pt;
> >> margin-bottom:0pt;
> >> color:#33CCCC;
> >> display:none;
> >> mso-hide:all;}
>
> >> /* Tečkové povely jsou označené tady */
> >> p.QuarxObycejnyText
> >> {mso-style-name:QuarxObycejnyText;
> >> mso-style-parent:QuarxZakladOdstavec;
> >> mso-style-next:QuarxPovel;
> >> font-size:12.0pt;
> >> margin-top:0pt;
> >> margin-right:0pt;
> >> margin-left:1.0cm;
> >> margin-bottom:0pt;
> >> font-family:"Courier New";}
>
> >> /* Tady je speciální označení nalezeného textu */
>
> >> span.QuarxFound
> >> {mso-style-name:QuarxFound;
> >> background:pink;}
>
> >> span.QuarxNalezenyText
> >> {mso-style-name:QuarxNalezenyText;
> >> background:yellow;
> >> border:1px solid lime;}
>
> >> --
> >> This e-mail address is fake, to keep spammers and their address
> >> harvesters out
> >> of my hair. If you want to get in touch personally, I am 'pdanes' and I
> >> use
> >> yahoo mail. But please use the newsgroup when possible, so that all may
> >> benefit from the exchange of ideas.- Hide quoted text -
>
> - Show quoted text - >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Apr 09, 2008 Posts: 457
|
(Msg. 7) Posted: Sat Dec 27, 2008 5:17 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Well you're the idiot that's stuck reccomending an obsolete database.
We're not the ones that are slanted-- YOU ARE.
JET IS OBSOLETE AND IT HAS BEEN FOR A DECADE.
-Aaron
On Dec 27, 4:52 pm, "Tony Toews [MVP]" wrote:
> "a a r o n . k e m p f @ g m a i l . c o m"
> wrote:
>
> >Access, however, is not perfect.
>
> And that paragraph is exceedingly slanted and by someone who clearly
> doesn't understand Access.
>
> How many hours did it take you to find that paragraph?
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Please respond only in the newsgroups so that others can
> read the entire thread of messages.
> Microsoft Access Links, Hints, Tips & Accounting Systems athttp://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/ >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Nov 15, 2007 Posts: 1217
|
(Msg. 8) Posted: Sat Dec 27, 2008 5:52 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
|
| Back to top |
|
 |  |
External

Since: Mar 08, 2008 Posts: 210
|
(Msg. 9) Posted: Sat Dec 27, 2008 9:01 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hi,
I went off the wagon today and said something about Aaron, and I said I
wouldn't months ago. Maybe it is time for this newsgroup to come up with a
standard response, agree on it and copy and paste as needed. No matter what
is said we respond with the same response. Something clear and simple for
the new person and something the expert can say...I've seen this before. If
no matter what he says he gets the same response, he will have no place to
go. He will eventualy go to another newsgroup.
My imput
Aaron always recommends MS SQL to all questions in this NewsGroup. Although
MS SQL Server is a great program it may not apply to many
situations...Please all, feel free to help make Aaron go away
\
"Tony Toews [MVP]" wrote in message
> "a a r o n . k e m p f @ g m a i l . c o m"
> wrote:
>
>>Access, however, is not perfect.
>
> And that paragraph is exceedingly slanted and by someone who clearly
> doesn't understand Access.
>
> How many hours did it take you to find that paragraph?
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Please respond only in the newsgroups so that others can
> read the entire thread of messages.
> Microsoft Access Links, Hints, Tips & Accounting Systems at
> http://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Nov 15, 2007 Posts: 1217
|
(Msg. 10) Posted: Sat Dec 27, 2008 9:01 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"Pete D." wrote:
>He will eventualy go to another newsgroup.
We've been hoping for several years.
>Aaron always recommends MS SQL to all questions in this NewsGroup. Although
>MS SQL Server is a great program it may not apply to many
>situations...Please all, feel free to help make Aaron go away
Hmm, gotta think about this a bit.
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Dec 13, 2003 Posts: 301
|
(Msg. 11) Posted: Sun Dec 28, 2008 6:10 am
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Sorry, but I've no idea why CSS/HTML is giving you so much trouble.
Personally, I don't use it for Word and I would probably use Automation if I
ever had to create a Word document. However, as this solution seems to be
to slow in your case, suggesting to take a look at the RTF format seems to
be a promising path.
I've also noticed that you are using a template to create your new document
and that this document is probably using the standard Normal.DOT file for
its basic formatting. Maybe one of these is the source of your problem.
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Petr Danes" wrote in message
> Hm, hadn't thought of the RTF path. I'll have to study the specs and see
> if it can do everything I need. It looks promising, I had no idea that RTF
> was such a capable format. Including all the formatting inline may bulk
> the file a bit, but I'll give it a try.
>
> Still, the CSS/HTML route should work as well. Any ideas why it's giving
> me so much trouble?
>
> As for the Range.InsertFile, I forget now exactly why I did it that way,
> rather than simply opening a file, but there was a reason. I think maybe
> it was because the Open command opens a new document each time it is
> called, causing them to pile up when doing multiple searches.
>
>
>
> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
> píše v diskusním příspěvku
>> Instead of using Range.InsertFile, maybe you should open the HTML
>> document as an independant word document and then transfert it to the
>> real document. For an example, see:
>>
>> http://www.bokebb.com/dev/english/1990/posts/199082985.shtml
>>
>> Also, this example is about using a RTF document instead of using HTML;
>> maybe you should do the same and use RTF instead of HTML. I won't be
>> surprisde if you have a better control over your RTF documents than over
>> an HTML document.
>>
>> References on RTF:
>>
>> http://en.wikipedia.org/wiki/Rich_Text_Format
>>
>> http://www.microsoft.com/downloadS/details.aspx?familyid=DD422B8D-FF06...07-B476
>>
>> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txt...eId=692
>>
>> --
>> Sylvain Lafontaine, ing.
>> MVP - Technologies Virtual-PC
>> E-mail: sylvain aei ca (fill the blanks, no spam please)
>>
>>
>> "Petr Danes" wrote in message
>>
>>> Does anyone have any experience with loading a document -INTO-Word using
>>> HTML and a cascading style sheet? All the stuff I have found in the
>>> archives deals with exporting Word docs to HTML - I want to do the
>>> opposite.
>>>
>>> I have an ACCESS database that does lookups and uses VBA to create a
>>> Word document detailing the results. Initially, I had the database using
>>> a Word template to create the document, but the process was too slow to
>>> be useful, so I converted it to write out plain text HTML, with
>>> references to a cascading style sheet. The results are mixed. Speed is
>>> much improved, but Word's use of the styles I define in the CSS are hit
>>> and miss. A sample few lines of the generated HTML text and the entire
>>> style sheet are reproduced at the end of this post.
>>>
>>> The basic definition, the first style, named QuarxZakladOdstavec does
>>> not appear at all in the created Word document, unless I add some
>>> unnecessary text specifically using that style. The subsequent
>>> definitions, which I would like to be based on this first one are not,
>>> but are based on Normal. Some of the graphic definitions, specifically
>>> margins, seem to be ignored completely. The styles are affected by
>>> whatever styles are already present in Word, in fact, they seem to take
>>> precedence over those defined in the CSS file, and I have to run some
>>> VBA code which deletes all 'Quarx' styles before some changes take
>>> effect. (But not all, some CSS styles do take effect next time the HTML
>>> file is loaded, even if the old style remains.) The Access code opens a
>>> Word template, which uses this line to load the HTML file:
>>> doc.Range.InsertFile FileName:="abc.htm"
>>> if that makes any difference.
>>>
>>> Word is capable of creating this stuff from its native files as well as
>>> reading files in this and other formats, but my results seem almost
>>> random. If anyone can shed some light on this, or maybe even suggest a
>>> different approach altogether, I'd appreciate some thoughts.
>>>
>>> Pete
>>>
>>>
>>>
>>> =====================================================
>>> Beginning of generated HTML text file:
>>>
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>>> <head>
>>> <title>Class and ID Selectors</title>
>>> <meta http-equiv="Content-Type"
>>> content="text/xhtml;charset=windows-1250"/>
>>> <link rel='stylesheet' type='text/css' href='C:\Users\Petr
>>> Danes\AppData\Local\Temp\QuarxStylesheet 2008-12-16_14-29-12.css'/>
>>> </head>
>>> <body >
>>> <p class='QuarxZakladOdstavec'>
>>> ABCEDFG
>>> <p class='QuarxHS'>
>>> ._HS Gottaischer	[C:\Palma\T602\Hyper\A test\BATEL\BATELOV.TXT]
>>> {001}
>>> </p>
>>> <p class='QuarxPovel'>
>>> .AU
>>> </p>
>>> <p class='QuarxAutor'>
>>> Gottaischer
>>> </p>
>>> <p class='QuarxPovel'>
>>> .TI
>>> </p>
>>> <p class='QuarxObycejnyText'>
>>> Gottaischer Hofkalender fuer 1779, 1780.
>>> </p>
>>> <p class='QuarxPovel'>
>>> .IM
>>> </p>
>>> <p class='QuarxObycejnyText'>
>>> Goth a, s. t., 1779, 1780, 110, 175 s., 8´.
>>> </p>
>>> <p class='QuarxPovel'>
>>> .RO
>>> </p>
>>> <p class='QuarxObycejnyText'>
>>>
>>> </p>
>>> <p class='QuarxPovel'>
>>>
>>> <!--
>>>
>>>
>>>
>>> Entire CSS file
>>>
>>> /* Style Definitions */
>>>
>>> /* Tohle je základ pro všechny další styly, použité pro různá označení
>>> */
>>>
>>> p.QuarxZakladOdstavec
>>> {mso-style-name:QuarxZakladOdstavec;
>>> mso-style-parent:"Normal";
>>> mso-pagination:widow-orphan;
>>> font-size:12.0pt;
>>> margin-top:0pt;
>>> margin-bottom:0pt;
>>> font-family:"Courier New";}
>>>
>>> /* Autor, signatura a datum jsou speciálně označené, aby byly rychle
>>> vidět */
>>>
>>> p.QuarxAutor
>>> {mso-style-name:QuarxAutor;
>>> mso-style-parent:QuarxZakladOdstavec;
>>> font-size:12.0pt;
>>> margin-top:0pt;
>>> margin-bottom:0pt;
>>> color:red;
>>> font-weight:bold;}
>>> p.QuarxSignatura
>>> {mso-style-name:QuarxSignatura;
>>> mso-style-parent:QuarxZakladOdstavec;
>>> color:blue;
>>> font-weight:bold;}
>>> p.QuarxDatum
>>> {mso-style-name:QuarxDatum;
>>> mso-style-parent:QuarxZakladOdstavec;
>>> color:#44BB44;
>>> font-weight:bold;
>>> text-decoration:underline;
>>> text-underline:single;}
>>> p.QuarxProvenience
>>> {mso-style-name:QuarxProvenience;
>>> mso-style-parent:QuarxZakladOdstavec;
>>> font-size:12.0pt;
>>> margin-top:0pt;
>>> margin-bottom:0pt;
>>> font-weight:bold;}
>>>
>>> /* Záhlaví, označené pomocí ._HS, je barvené podle toho, jestli heslo
>>> obsahuje nebo neobsahuje hledaný text */
>>>
>>> p.QuarxHS
>>> {mso-style-name:QuarxHS;
>>> mso-style-parent:QuarxZakladOdstavec;
>>> mso-style-next:QuarxZakladOdstavec;
>>> page-break-before:always;
>>> mso-border-top-alt:solid black 0.5pt;
>>> tab-stops:right 468.0pt;
>>> font-size:8.0pt;
>>> margin-top:0pt;
>>> margin-bottom:0pt;
>>> color:#999999;}
>>>
>>>
>>> /* Tečkové povely jsou označené tady */
>>>
>>> p.QuarxPovel
>>> {mso-style-name:QuarxPovel;
>>> mso-style-parent:QuarxZakladOdstavec;
>>> mso-style-next:QuarxZakladOdstavec;
>>> font-size:8.0pt;
>>> margin-top:0pt;
>>> margin-bottom:0pt;
>>> color:#33CCCC;
>>> display:none;
>>> mso-hide:all;}
>>>
>>>
>>> /* Tečkové povely jsou označené tady */
>>> p.QuarxObycejnyText
>>> {mso-style-name:QuarxObycejnyText;
>>> mso-style-parent:QuarxZakladOdstavec;
>>> mso-style-next:QuarxPovel;
>>> font-size:12.0pt;
>>> margin-top:0pt;
>>> margin-right:0pt;
>>> margin-left:1.0cm;
>>> margin-bottom:0pt;
>>> font-family:"Courier New";}
>>>
>>>
>>> /* Tady je speciální označení nalezeného textu */
>>>
>>> span.QuarxFound
>>> {mso-style-name:QuarxFound;
>>> background:pink;}
>>>
>>> span.QuarxNalezenyText
>>> {mso-style-name:QuarxNalezenyText;
>>> background:yellow;
>>> border:1px solid lime;}
>>>
>>>
>>>
>>> --
>>> This e-mail address is fake, to keep spammers and their address
>>> harvesters out
>>> of my hair. If you want to get in touch personally, I am 'pdanes' and I
>>> use
>>> yahoo mail. But please use the newsgroup when possible, so that all may
>>> benefit from the exchange of ideas.
>>>
>>>
>>
>>
> >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Mar 18, 2008 Posts: 8
|
(Msg. 12) Posted: Sun Dec 28, 2008 5:05 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
I'm looking at the RTF specs. Whew, they're complicated. Maybe if I generate
my text once, then ask word to save it as an RTF file and examine the
result, it will shed some light on the subject. I'll try that next.
Yes, automation is the natural choice and is the first thing I tried. It
worked, quite well in fact, but was simply too slow to be practical.
I'm not sure I understand you regarding the template issue. I do have a
custom template, in fact, it's stored in the database as a blob and written
into the temp directory if it's not already there. Same with the CSS file.
The intention was to make the database completely self-contained, that is,
one-file portable. I know how to break the AttachedTemplate link from the
document, but this sounds like there may be more. Is there some tie between
a custom template and Normal.DOT? If so, what do I do about it?
Pete
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)> píše
v diskusním příspěvku
> Sorry, but I've no idea why CSS/HTML is giving you so much trouble.
> Personally, I don't use it for Word and I would probably use Automation if
> I ever had to create a Word document. However, as this solution seems to
> be to slow in your case, suggesting to take a look at the RTF format seems
> to be a promising path.
>
> I've also noticed that you are using a template to create your new
> document and that this document is probably using the standard Normal.DOT
> file for its basic formatting. Maybe one of these is the source of your
> problem.
>
> --
> Sylvain Lafontaine, ing.
> MVP - Technologies Virtual-PC
> E-mail: sylvain aei ca (fill the blanks, no spam please)
>
>
> "Petr Danes" wrote in message
>
>> Hm, hadn't thought of the RTF path. I'll have to study the specs and see
>> if it can do everything I need. It looks promising, I had no idea that
>> RTF was such a capable format. Including all the formatting inline may
>> bulk the file a bit, but I'll give it a try.
>>
>> Still, the CSS/HTML route should work as well. Any ideas why it's giving
>> me so much trouble?
>>
>> As for the Range.InsertFile, I forget now exactly why I did it that way,
>> rather than simply opening a file, but there was a reason. I think maybe
>> it was because the Open command opens a new document each time it is
>> called, causing them to pile up when doing multiple searches.
>>
>>
>>
>> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
>> píše v diskusním příspěvku
>>> Instead of using Range.InsertFile, maybe you should open the HTML
>>> document as an independant word document and then transfert it to the
>>> real document. For an example, see:
>>>
>>> http://www.bokebb.com/dev/english/1990/posts/199082985.shtml
>>>
>>> Also, this example is about using a RTF document instead of using HTML;
>>> maybe you should do the same and use RTF instead of HTML. I won't be
>>> surprisde if you have a better control over your RTF documents than over
>>> an HTML document.
>>>
>>> References on RTF:
>>>
>>> http://en.wikipedia.org/wiki/Rich_Text_Format
>>>
>>> http://www.microsoft.com/downloadS/details.aspx?familyid=DD422B8D-FF06...07-B476
>>>
>>> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txt...eId=692
>>>
>>> --
>>> Sylvain Lafontaine, ing.
>>> MVP - Technologies Virtual-PC
>>> E-mail: sylvain aei ca (fill the blanks, no spam please)
>>>
>>>
>>> "Petr Danes" wrote in message
>>>
>>>> Does anyone have any experience with loading a document -INTO-Word
>>>> using HTML and a cascading style sheet? All the stuff I have found in
>>>> the archives deals with exporting Word docs to HTML - I want to do the
>>>> opposite.
>>>>
>>>> I have an ACCESS database that does lookups and uses VBA to create a
>>>> Word document detailing the results. Initially, I had the database
>>>> using a Word template to create the document, but the process was too
>>>> slow to be useful, so I converted it to write out plain text HTML, with
>>>> references to a cascading style sheet. The results are mixed. Speed is
>>>> much improved, but Word's use of the styles I define in the CSS are hit
>>>> and miss. A sample few lines of the generated HTML text and the entire
>>>> style sheet are reproduced at the end of this post.
>>>>
>>>> The basic definition, the first style, named QuarxZakladOdstavec does
>>>> not appear at all in the created Word document, unless I add some
>>>> unnecessary text specifically using that style. The subsequent
>>>> definitions, which I would like to be based on this first one are not,
>>>> but are based on Normal. Some of the graphic definitions, specifically
>>>> margins, seem to be ignored completely. The styles are affected by
>>>> whatever styles are already present in Word, in fact, they seem to take
>>>> precedence over those defined in the CSS file, and I have to run some
>>>> VBA code which deletes all 'Quarx' styles before some changes take
>>>> effect. (But not all, some CSS styles do take effect next time the HTML
>>>> file is loaded, even if the old style remains.) The Access code opens a
>>>> Word template, which uses this line to load the HTML file:
>>>> doc.Range.InsertFile FileName:="abc.htm"
>>>> if that makes any difference.
>>>>
>>>> Word is capable of creating this stuff from its native files as well as
>>>> reading files in this and other formats, but my results seem almost
>>>> random. If anyone can shed some light on this, or maybe even suggest a
>>>> different approach altogether, I'd appreciate some thoughts.
>>>>
>>>> Pete
>>>>
>>>>
>>>>
>>>> =====================================================
>>>> Beginning of generated HTML text file:
>>>>
>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>>>> <head>
>>>> <title>Class and ID Selectors</title>
>>>> <meta http-equiv="Content-Type"
>>>> content="text/xhtml;charset=windows-1250"/>
>>>> <link rel='stylesheet' type='text/css' href='C:\Users\Petr
>>>> Danes\AppData\Local\Temp\QuarxStylesheet 2008-12-16_14-29-12.css'/>
>>>> </head>
>>>> <body >
>>>> <p class='QuarxZakladOdstavec'>
>>>> ABCEDFG
>>>> <p class='QuarxHS'>
>>>> ._HS Gottaischer	[C:\Palma\T602\Hyper\A test\BATEL\BATELOV.TXT]
>>>> {001}
>>>> </p>
>>>> <p class='QuarxPovel'>
>>>> .AU
>>>> </p>
>>>> <p class='QuarxAutor'>
>>>> Gottaischer
>>>> </p>
>>>> <p class='QuarxPovel'>
>>>> .TI
>>>> </p>
>>>> <p class='QuarxObycejnyText'>
>>>> Gottaischer Hofkalender fuer 1779, 1780.
>>>> </p>
>>>> <p class='QuarxPovel'>
>>>> .IM
>>>> </p>
>>>> <p class='QuarxObycejnyText'>
>>>> Goth a, s. t., 1779, 1780, 110, 175 s., 8´.
>>>> </p>
>>>> <p class='QuarxPovel'>
>>>> .RO
>>>> </p>
>>>> <p class='QuarxObycejnyText'>
>>>>
>>>> </p>
>>>> <p class='QuarxPovel'>
>>>>
>>>> <!--
>>>>
>>>>
>>>>
>>>> Entire CSS file
>>>>
>>>> /* Style Definitions */
>>>>
>>>> /* Tohle je základ pro všechny další styly, použité pro různá označení
>>>> */
>>>>
>>>> p.QuarxZakladOdstavec
>>>> {mso-style-name:QuarxZakladOdstavec;
>>>> mso-style-parent:"Normal";
>>>> mso-pagination:widow-orphan;
>>>> font-size:12.0pt;
>>>> margin-top:0pt;
>>>> margin-bottom:0pt;
>>>> font-family:"Courier New";}
>>>>
>>>> /* Autor, signatura a datum jsou speciálně označené, aby byly rychle
>>>> vidět */
>>>>
>>>> p.QuarxAutor
>>>> {mso-style-name:QuarxAutor;
>>>> mso-style-parent:QuarxZakladOdstavec;
>>>> font-size:12.0pt;
>>>> margin-top:0pt;
>>>> margin-bottom:0pt;
>>>> color:red;
>>>> font-weight:bold;}
>>>> p.QuarxSignatura
>>>> {mso-style-name:QuarxSignatura;
>>>> mso-style-parent:QuarxZakladOdstavec;
>>>> color:blue;
>>>> font-weight:bold;}
>>>> p.QuarxDatum
>>>> {mso-style-name:QuarxDatum;
>>>> mso-style-parent:QuarxZakladOdstavec;
>>>> color:#44BB44;
>>>> font-weight:bold;
>>>> text-decoration:underline;
>>>> text-underline:single;}
>>>> p.QuarxProvenience
>>>> {mso-style-name:QuarxProvenience;
>>>> mso-style-parent:QuarxZakladOdstavec;
>>>> font-size:12.0pt;
>>>> margin-top:0pt;
>>>> margin-bottom:0pt;
>>>> font-weight:bold;}
>>>>
>>>> /* Záhlaví, označené pomocí ._HS, je barvené podle toho, jestli heslo
>>>> obsahuje nebo neobsahuje hledaný text */
>>>>
>>>> p.QuarxHS
>>>> {mso-style-name:QuarxHS;
>>>> mso-style-parent:QuarxZakladOdstavec;
>>>> mso-style-next:QuarxZakladOdstavec;
>>>> page-break-before:always;
>>>> mso-border-top-alt:solid black 0.5pt;
>>>> tab-stops:right 468.0pt;
>>>> font-size:8.0pt;
>>>> margin-top:0pt;
>>>> margin-bottom:0pt;
>>>> color:#999999;}
>>>>
>>>>
>>>> /* Tečkové povely jsou označené tady */
>>>>
>>>> p.QuarxPovel
>>>> {mso-style-name:QuarxPovel;
>>>> mso-style-parent:QuarxZakladOdstavec;
>>>> mso-style-next:QuarxZakladOdstavec;
>>>> font-size:8.0pt;
>>>> margin-top:0pt;
>>>> margin-bottom:0pt;
>>>> color:#33CCCC;
>>>> display:none;
>>>> mso-hide:all;}
>>>>
>>>>
>>>> /* Tečkové povely jsou označené tady */
>>>> p.QuarxObycejnyText
>>>> {mso-style-name:QuarxObycejnyText;
>>>> mso-style-parent:QuarxZakladOdstavec;
>>>> mso-style-next:QuarxPovel;
>>>> font-size:12.0pt;
>>>> margin-top:0pt;
>>>> margin-right:0pt;
>>>> margin-left:1.0cm;
>>>> margin-bottom:0pt;
>>>> font-family:"Courier New";}
>>>>
>>>>
>>>> /* Tady je speciální označení nalezeného textu */
>>>>
>>>> span.QuarxFound
>>>> {mso-style-name:QuarxFound;
>>>> background:pink;}
>>>>
>>>> span.QuarxNalezenyText
>>>> {mso-style-name:QuarxNalezenyText;
>>>> background:yellow;
>>>> border:1px solid lime;}
>>>>
>>>>
>>>>
>>>> --
>>>> This e-mail address is fake, to keep spammers and their address
>>>> harvesters out
>>>> of my hair. If you want to get in touch personally, I am 'pdanes' and I
>>>> use
>>>> yahoo mail. But please use the newsgroup when possible, so that all may
>>>> benefit from the exchange of ideas.
>>>>
>>>>
>>>
>>>
>>
>
> >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Apr 09, 2008 Posts: 457
|
(Msg. 13) Posted: Mon Dec 29, 2008 6:56 am
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Have you considered using SQL Server Reporting Services to export to
Word?
It works about 100 times better than MS Access, especially if you use
SQL 2008.
Microsoft bought 'SoftArtisans' and integrated their products into SQL
2008 SSRS, which is just a fantastic improvement, IMHO
On Dec 28, 8:05 am, "Petr Danes" wrote:
> I'm looking at the RTF specs. Whew, they're complicated. Maybe if I generate
> my text once, then ask word to save it as an RTF file and examine the
> result, it will shed some light on the subject. I'll try that next.
>
> Yes, automation is the natural choice and is the first thing I tried. It
> worked, quite well in fact, but was simply too slow to be practical.
>
> I'm not sure I understand you regarding the template issue. I do have a
> custom template, in fact, it's stored in the database as a blob and written
> into the temp directory if it's not already there. Same with the CSS file..
> The intention was to make the database completely self-contained, that is,
> one-file portable. I know how to break the AttachedTemplate link from the
> document, but this sounds like there may be more. Is there some tie between
> a custom template and Normal.DOT? If so, what do I do about it?
>
> Pete
>
> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)> píše
> v diskusním příspěvkunews:O1FrczNaJHA.4084@TK2MSFTNGP04.phx.gbl....
>
>
>
> > Sorry, but I've no idea why CSS/HTML is giving you so much trouble.
> > Personally, I don't use it for Word and I would probably use Automation if
> > I ever had to create a Word document. However, as this solution seems to
> > be to slow in your case, suggesting to take a look at the RTF format seems
> > to be a promising path.
>
> > I've also noticed that you are using a template to create your new
> > document and that this document is probably using the standard Normal.DOT
> > file for its basic formatting. Maybe one of these is the source of your
> > problem.
>
> > --
> > Sylvain Lafontaine, ing.
> > MVP - Technologies Virtual-PC
> > E-mail: sylvain aei ca (fill the blanks, no spam please)
>
> > "Petr Danes" wrote in message
> >
> >> Hm, hadn't thought of the RTF path. I'll have to study the specs and see
> >> if it can do everything I need. It looks promising, I had no idea that
> >> RTF was such a capable format. Including all the formatting inline may
> >> bulk the file a bit, but I'll give it a try.
>
> >> Still, the CSS/HTML route should work as well. Any ideas why it's giving
> >> me so much trouble?
>
> >> As for the Range.InsertFile, I forget now exactly why I did it that way,
> >> rather than simply opening a file, but there was a reason. I think maybe
> >> it was because the Open command opens a new document each time it is
> >> called, causing them to pile up when doing multiple searches.
>
> >> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
> >> píše v diskusním příspěvkunews:ebQqNe5ZJHA.4520@TK2MSFTNGP06.phx.gbl...
> >>> Instead of using Range.InsertFile, maybe you should open the HTML
> >>> document as an independant word document and then transfert it to the
> >>> real document. For an example, see:
>
> >>>http://www.bokebb.com/dev/english/1990/posts/199082985.shtml
>
> >>> Also, this example is about using a RTF document instead of using HTML;
> >>> maybe you should do the same and use RTF instead of HTML. I won't be
> >>> surprisde if you have a better control over your RTF documents than over
> >>> an HTML document.
>
> >>> References on RTF:
>
> >>>http://en.wikipedia.org/wiki/Rich_Text_Format
>
> >>>http://www.microsoft.com/downloadS/details.aspx?familyid=DD422B8D-FF0...
>
> >>>http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&tx...
>
> >>> --
> >>> Sylvain Lafontaine, ing.
> >>> MVP - Technologies Virtual-PC
> >>> E-mail: sylvain aei ca (fill the blanks, no spam please)
>
> >>> "Petr Danes" wrote in message
> >>>
> >>>> Does anyone have any experience with loading a document -INTO-Word
> >>>> using HTML and a cascading style sheet? All the stuff I have found in
> >>>> the archives deals with exporting Word docs to HTML - I want to do the
> >>>> opposite.
>
> >>>> I have an ACCESS database that does lookups and uses VBA to create a
> >>>> Word document detailing the results. Initially, I had the database
> >>>> using a Word template to create the document, but the process was too
> >>>> slow to be useful, so I converted it to write out plain text HTML, with
> >>>> references to a cascading style sheet. The results are mixed. Speed is
> >>>> much improved, but Word's use of the styles I define in the CSS are hit
> >>>> and miss. A sample few lines of the generated HTML text and the entire
> >>>> style sheet are reproduced at the end of this post.
>
> >>>> The basic definition, the first style, named QuarxZakladOdstavec does
> >>>> not appear at all in the created Word document, unless I add some
> >>>> unnecessary text specifically using that style. The subsequent
> >>>> definitions, which I would like to be based on this first one are not,
> >>>> but are based on Normal. Some of the graphic definitions, specifically
> >>>> margins, seem to be ignored completely. The styles are affected by
> >>>> whatever styles are already present in Word, in fact, they seem to take
> >>>> precedence over those defined in the CSS file, and I have to run some
> >>>> VBA code which deletes all 'Quarx' styles before some changes take
> >>>> effect. (But not all, some CSS styles do take effect next time the HTML
> >>>> file is loaded, even if the old style remains.) The Access code opens a
> >>>> Word template, which uses this line to load the HTML file:
> >>>> doc.Range.InsertFile FileName:="abc.htm"
> >>>> if that makes any difference.
>
> >>>> Word is capable of creating this stuff from its native files as well as
> >>>> reading files in this and other formats, but my results seem almost
> >>>> random. If anyone can shed some light on this, or maybe even suggest a
> >>>> different approach altogether, I'd appreciate some thoughts.
>
> >>>> Pete
>
> >>>> =====================================================
> >>>> Beginning of generated HTML text file:
>
> >>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> >>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
> >>>> <head>
> >>>> <title>Class and ID Selectors</title>
> >>>> <meta http-equiv="Content-Type"
> >>>> content="text/xhtml;charset=windows-1250"/>
> >>>> <link rel='stylesheet' type='text/css' href='C:\Users\Petr
> >>>> Danes\AppData\Local\Temp\QuarxStylesheet 2008-12-16_14-29-12.css'/>
> >>>> </head>
> >>>> <body >
> >>>> <p class='QuarxZakladOdstavec'>
> >>>> ABCEDFG
> >>>> <p class='QuarxHS'>
> >>>> ._HS Gottaischer	[C:\Palma\T602\Hyper\A test\BATEL\BATELOV.TXT]
> >>>> {001}
> >>>> </p>
> >>>> <p class='QuarxPovel'>
> >>>> .AU
> >>>> </p>
> >>>> <p class='QuarxAutor'>
> >>>> Gottaischer
> >>>> </p>
> >>>> <p class='QuarxPovel'>
> >>>> .TI
> >>>> </p>
> >>>> <p class='QuarxObycejnyText'>
> >>>> Gottaischer Hofkalender fuer 1779, 1780.
> >>>> </p>
> >>>> <p class='QuarxPovel'>
> >>>> .IM
> >>>> </p>
> >>>> <p class='QuarxObycejnyText'>
> >>>> Goth a, s. t., 1779, 1780, 110, 175 s., 8´.
> >>>> </p>
> >>>> <p class='QuarxPovel'>
> >>>> .RO
> >>>> </p>
> >>>> <p class='QuarxObycejnyText'>
>
> >>>> </p>
> >>>> <p class='QuarxPovel'>
>
> >>>> <!--
>
> >>>> Entire CSS file
>
> >>>> /* Style Definitions */
>
> >>>> /* Tohle je základ pro všechny další styly, použité pro různá označení
> >>>> */
>
> >>>> p.QuarxZakladOdstavec
> >>>> {mso-style-name:QuarxZakladOdstavec;
> >>>> mso-style-parent:"Normal";
> >>>> mso-pagination:widow-orphan;
> >>>> font-size:12.0pt;
> >>>> margin-top:0pt;
> >>>> margin-bottom:0pt;
> >>>> font-family:"Courier New";}
>
> >>>> /* Autor, signatura a datum jsou speciálně označené, aby byly rychle
> >>>> vidět */
>
> >>>> p.QuarxAutor
> >>>> {mso-style-name:QuarxAutor;
> >>>> mso-style-parent:QuarxZakladOdstavec;
> >>>> font-size:12.0pt;
> >>>> margin-top:0pt;
> >>>> margin-bottom:0pt;
> >>>> color:red;
> >>>> font-weight:bold;}
> >>>> p.QuarxSignatura
> >>>> {mso-style-name:QuarxSignatura;
> >>>> mso-style-parent:QuarxZakladOdstavec;
> >>>> color:blue;
> >>>> font-weight:bold;}
> >>>> p.QuarxDatum
> >>>> {mso-style-name:QuarxDatum;
> >>>> mso-style-parent:QuarxZakladOdstavec;
> >>>> color:#44BB44;
> >>>> font-weight:bold;
> >>>> text-decoration:underline;
> >>>> text-underline:single;}
> >>>> p.QuarxProvenience
> >>>> {mso-style-name:QuarxProvenience;
> >>>> mso-style-parent:QuarxZakladOdstavec;
> >>>> font-size:12.0pt;
> >>>> margin-top:0pt;
> >>>> margin-bottom:0pt;
> >>>> font-weight:bold;}
>
> >>>> /* Záhlaví, označené pomocí ._HS, je barvené podle toho, jestli heslo
> >>>> obsahuje nebo neobsahuje hledaný text */
>
> >>>> p.QuarxHS
> >>>> {mso-style-name:QuarxHS;
> >>>> mso-style-parent:QuarxZakladOdstavec;
> >>>> mso-style-next:QuarxZakladOdstavec;
> >>>> page-break-before:always;
> >>>> mso-border-top-alt:solid black 0.5pt;
> >>>> tab-stops:right 468.0pt;
> >>>> font-size:8.0pt;
> >>>> margin-top:0pt;
> >>>> margin-bottom:0pt;
> >>>> color:#999999;}
>
> >>>> /* Tečkové povely jsou označené tady */
>
> >>>> p.QuarxPovel
> >>>> {mso-style-name:QuarxPovel;
> >>>> mso-style-parent:QuarxZakladOdstavec;
> >>>> mso-style-next:QuarxZakladOdstavec;
> >>>> font-size:8.0pt;
> >>>> margin-top:0pt;
> >>>> margin-bottom:0pt;
> >>>> color:#33CCCC;
> >>>> display:none;
> >>>> mso-hide:all;}
>
> >>>> /* Tečkové povely jsou označené tady */
> >>>> p.QuarxObycejnyText
> >>>> {mso-style-name:QuarxObycejnyText;
> >>>> mso-style-parent:QuarxZakladOdstavec;
> >>>> mso-style-next:QuarxPovel;
> >>>> font-size:12.0pt;
> >>>> margin-top:0pt;
> >>>> margin-right:0pt;
> >>>> margin-left:1.0cm;
> >>>> margin-bottom:0pt;
> >>>> font-family:"Courier New";}
>
> >>>> /* Tady je speciální označení nalezeného textu */
>
> >>>> span.QuarxFound
> >>>> {mso-style-name:QuarxFound;
> >>>> background:pink;}
>
> >>>> span.QuarxNalezenyText
> >>>> {mso-style-name:QuarxNalezenyText;
> >>>> background:yellow;
> >>>> border:1px solid lime;}
>
> >>>> --
> >>>> This e-mail address is fake, to keep spammers and their address
> >>>> harvesters out
> >>>> of my hair. If you
>
> ...
>
> read more ť- Hide quoted text -
>
> - Show quoted text - >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Dec 29, 2008 Posts: 4
|
(Msg. 14) Posted: Mon Dec 29, 2008 12:44 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: microsoft>public>word>programming, others (more info?)
|
|
|
"a a r o n . k e m p f @ g m a i l . c o" wrote:
> Have you considered using SQL Server Reporting
> Services to export to Word?
I never expected to find a dumb squarehead hanging around, pushing SQL after
being laughed out of the SQL groups.
That's Mr. Kowalski to you >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
External

Since: Apr 09, 2008 Posts: 457
|
(Msg. 15) Posted: Mon Dec 29, 2008 9:21 pm
Post subject: Re: Access to create HTML file for WORD [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
getting laughed out of the SQL groups?
what exactly are you referring to?
I don't need to save people in the SQL groups-- everyone knows that
SQL Server is the worlds most popular database
On Dec 29, 12:44 pm, Walt Kowalski
wrote:
> "a a r o n . k e m p f @ g m a i l . c o" wrote:
>
> > Have you considered using SQL Server Reporting
> > Services to export to Word?
>
> I never expected to find a dumb squarehead hanging around, pushing SQL after
> being laughed out of the SQL groups.
>
> That's Mr. Kowalski to you >> Stay informed about: Access to create HTML file for WORD |
|
| Back to top |
|
 |  |
| Related Topics: | Can Access create Word documents? - Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE....
Merged records to Word from Access-Create page break based.. - I have merged the data from Access. Now I need Word to start a new page every time the sequence number changes. How is this accomplished? Also, is it possible to tell Word to hide duplicates? On some pages, the Owner will have multiple accounts. I d...
pulling data from ACCESS to html file via vbscript - Hi everyone can someone can give me a code sample of vbscript that presenting ACCESS database on html without usaghe of DSN
html tags in report OR image url to display in exported ht.. - Hi, I have a data base. One field contains an image url e.g. http://www.zionmusiccenter.com/catalog/as224ps-f.jpg I would like to be able to create from each record of my database an html page. In this page, I would like to show the abovementioned..
Req help: How do I open a MS Word file from Access? - Hi all, I created a button in an Access form that opens MS Word. Now I want this button also to open a specific file. How do I code this? Would it also be possible to let the user select the type of template from a list? It would be perfect if this.. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|