Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

DoCmd.TransferText acExportHTML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wykpisz - 24 Mar 2005 03:31 GMT
When using this command above, is there a way to determine the font size of
the final product? I'm exporting a query but need the font size of the
information bigger like 24 font. So I've gotten this far but not sure what
the template would be, like the coding. I tried to make a template to enlarge
the font. This is what I have;
DoCmd.OutputTo acOutputQuery, "Messages", acFormatHTML,
"C:\MessagesForAssociates2.html", 0, "C:\template.html"

The html code for the template is:
<html>
<TABLE BORDER=1 BGCOLOR=#ffffff CELLSPACING=0><FONT FACE="Arial" size ="7"
COLOR=#000000><CAPTION><B>Messages</B></CAPTION></FONT>
</TABLE>
</body>
</html>

What am I doing wrong?
Rob Oldfield - 24 Mar 2005 09:23 GMT
I remember looking at how to use template files about a year ago... and
failed to find anything at all.  Seems to be one of those things that Access
is supposed to be able to do but nobody knows how.

I ended up just outputting the file without the template, and using code to
open the text file and making the adjustments I needed directly.

> When using this command above, is there a way to determine the font size of
> the final product? I'm exporting a query but need the font size of the
[quoted text clipped - 13 lines]
>
> What am I doing wrong?
Dirk Goldgar - 24 Mar 2005 19:40 GMT
> I remember looking at how to use template files about a year ago...
> and failed to find anything at all.  Seems to be one of those things
[quoted text clipped - 3 lines]
> code to open the text file and making the adjustments I needed
> directly.

I was just searching for this the other day, in response to a different
post.  There wasn't much, but I did find this:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/office97/html/d
evelopingapplicationsfortheinternetworldwideweb.asp


Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Rob Oldfield - 24 Mar 2005 20:43 GMT
> > I remember looking at how to use template files about a year ago...
> > and failed to find anything at all.  Seems to be one of those things
[quoted text clipped - 6 lines]
> I was just searching for this the other day, in response to a different
> post.  There wasn't much, but I did find this:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/office97/html/d
evelopingapplicationsfortheinternetworldwideweb.asp


Nice find.  I still can't figure out how you'd actually alter the structure
of the output table though.  And I don't have the Access 97 example
templates available.
Dirk Goldgar - 25 Mar 2005 05:19 GMT
> Nice find.  I still can't figure out how you'd actually alter the
> structure of the output table though.  And I don't have the Access 97
> example templates available.

That article is the sum total of my knowledge on the subject, I'm
afraid.  If *you* happen to find anything, let me know.

<g>

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Rob Oldfield - 25 Mar 2005 12:08 GMT
> > Nice find.  I still can't figure out how you'd actually alter the
> > structure of the output table though.  And I don't have the Access 97
[quoted text clipped - 4 lines]
>
> <g>

OK.  I managed to find a copy of A97.  There is one of the templates
attached to the NorthWind db.  That looks like this...

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">

<TITLE><!--ACCESSTEMPLATE_TITLE--></TITLE>
<META NAME="DocumentEn" CONTENT="windows-1252">

</HEAD>
<BODY LINK="#0000ff" VLINK="#800080">
<IMG SRC="NWlogo.GIF"> <FONT SIZE=4 FACE="Book Antiqua">Northwind
Traders</FONT>
<HR>

<!--ACCESSTEMPLATE_BODY--> <BR>
<A HREF="<!--AccessTemplate_FirstPage-->">First</A>
<A HREF="<!--AccessTemplate_PreviousPage-->">Previous</A>
<A HREF="<!--AccessTemplate_NextPage-->">Next</A>
<A HREF="<!--AccessTemplate_LastPage-->">Last</A>

</BODY>
</HTML>

...so you can include a size tag in there - but only at the global level.
The way that the sample uses it, they actually base the output on a report
instead of a query.  So acOutputReport instead of acOutputQuery.  The html
output then picks up the format from the report - so ....

...although you can include the font size, it only gets applied to the title
text.  You can also a font tag to the template

<font size=24>
<A HREF="<!--AccessTemplate_FirstPage-->">First</A>
<A HREF="<!--AccessTemplate_PreviousPage-->">Previous</A>
<A HREF="<!--AccessTemplate_NextPage-->">Next</A>
<A HREF="<!--AccessTemplate_LastPage-->">Last</A>
</font>

...and that will be applied to those links.

Borders... there doesn't seem to be any way of applying those.  Think you'd
have to fall back on editing the text file.

So, to summarise, it seems that you can use the template to format header
and footer information, but the actual body is determined by formatting
applied in Access, which is why you'd normally use a report instead of a
query.

There are some other sample template documents but they just seem to be
doing things like setting background graphics.... e.g.....

<HTML>
<TITLE><!--ACCESSTEMPLATE_TITLE--></TITLE>
<BODY background = sky.jpg>
<!--ACCESSTEMPLATE_BODY-->
</BODY>
<BR><BR>
<IMG SRC = "msaccess.jpg">
</HTML>

If anyone wants to see those, let me have a mail address and I'll forward
them.
Dirk Goldgar - 29 Mar 2005 16:26 GMT
> OK.  I managed to find a copy of A97.  There is one of the templates
> attached to the NorthWind db.  That looks like this...
[quoted text clipped - 62 lines]
> If anyone wants to see those, let me have a mail address and I'll
> forward them.

Thanks for posting the results of your research, Rob.  I'll tuck this
away in case I ever have a use for it.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

wykpisz - 30 Mar 2005 06:13 GMT
This is controlled by the query being run, not by the template. To
change the output font:
1. Run your query.
2. When you have the query results in a table in your screen, from the
Format menu, choose font.
3. Set the font options you want. Click OK.
4. Click the Save button.

Now, when you run the OutputTo command, it will use the font settings
saved in the query.

> > OK.  I managed to find a copy of A97.  There is one of the templates
> > attached to the NorthWind db.  That looks like this...
[quoted text clipped - 65 lines]
> Thanks for posting the results of your research, Rob.  I'll tuck this
> away in case I ever have a use for it.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.