Solved

set column widths in outlook whwn loading a query

Posted on 2016-08-30
2
37 Views
Last Modified: 2016-09-07
I have a query with 3 fields, A,B,C.  When I use DoCmd.OutputTo acOutputQuery, "QueryABC", acFormatHTML, "QABC.htm"  The C column is about half as wide as I would like it to be.  I want to automate these emails so I do not want to change it on each one.  I saw something about using a template but had no luck at all either creating or getting that to work.  How can I get this column wider?

Thanks.
0
Comment
Question by:vmccune
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 41777157
You don't really have much control over this process, so there's not much you can do, and using a Template would have no impact on the content spit out from the query. That would only control the "body" and such of the HTML document you send.

The only way to do this effectively is build the table yourself, in code, using standard HTML tags. I've done this in the past, and it's not too terribly difficult. You just do something like this;

dim html As String
Dim rst As DAO.Recordset
Set rst = Currentdb.OpenRecordset("SomeQueryOrSQL")
html = "<table><tr><td>ColumnHeader1</td><td>ColumnHeader2</td></tr>"
do Until rst.EOF
  html = html & "<tr><td>" & rst("Column1") & "</td><td>" & rst("Column2") & "</td></tr>"
  rst.MoveNext
Loop
html = html " & </table>

You can size the columns in the first "row" (where the html=<table> blah blah" line is). Consult any HTML tag resource to determine the valid tag attributes you can use.
0
 

Author Comment

by:vmccune
ID: 41788911
Got just what I wanted with this as a starting block.
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question