Access to Outlook Via Excel

P

Pradeep

Hello,

I am using Ms Access 2003. Per user requirement, I need to format the data
in a table and paste the same in outlook in such a way the gridlines etc do
not appear.

So i have written code in VBA (MS Access) which takes bits of information,
copies it to an excel sheet, formats it per the requirement specifications
and then moves it to Outlook.

Essentially i am trying to paste data into a outlook mailitem with a word
document viewer. The pre-requisite for this is:

1. Ensure that the Edit messages with Microsoft Word 2003 is selected in
Outlook under the Mail Format tab.

Here is the main segment of code i am using:

Dim objOutlook as object, objMailWindow as object, objInspector as object,
ObjDoc as word.Document, objExcel as object

set objOutlook= CreateObject("Outlook.Application")

set objMailWindow=objOutlook.MailItem(0)

with ObjMailWindow
set objInspector=.GetInspector
set objDoc=objInspector.WordEditor
End with

Now i move bits of information from Ms Access table into an Excel Workbook
object, format it per user requirements and then move it to out look with the
following statement.

objExcel.Selection.Copy

with objDoc
.Activate
.Selection.PasteExcelTable False,False,False
End with

Now the formatting is perfect and it appears as intended in Outllook. But
when the email is sent, the recepient receives it in a different format where
in he sees the grid lines.

How do i avoid it. The user wants to see it as it appears without any grid
lines.

Any help in this regard would be highly appreciated.

Thanks,

Pradeep
 
D

dch3

First, what is the intent? Are you trying to generate HTML-formatted emails
from Access? When your user says they don't want to see grid-lines are you
trying to send data formatted as a table in the message?

Second, you cannot, ever, never-in-a-million years, absolutely control what
the user sees due to the wide variety of machines, browsers, email programs
and other what not. You can greatly influence, but absolute control is an
absolute impossibility.

(Now that I'm off my soapbox...)
If you're trying to send HTML formatted email (which I think you are but may
not know it), you can create the HTML directly in Access using the
appropriate HTML tags and then set the .HTMLBody of the MailItem. I'm
assuming that theres a HTML table in the message based on the 'no gridlines'
comment. If so, you'll be using <table><tr><td></td></tr></table> to create
said. In the <table> tag using border=0 to supress the border. At any rate if
you are trying to send an HTML formatted email its not necessary to use
Excel, however you will need a familarity with HTML in order to create the
string to set the .HTML body to. Be aware though MS has chosen to modify the
HTML rendering engine used for Outlook 2007. (You *do not* have to go through
Word to create a HTML message as setting the .HTMLBody is all you have to
do.) As such there are certain tags that can't be used. The basic tags are
still usable, but its the tags such as <object></object> that can no longer
be used. For more information see these articles...

http://msdn.microsoft.com/en-us/library/aa338201.aspx
http://msdn.microsoft.com/en-us/library/aa171418(office.11).aspx
http://msdn.microsoft.com/en-us/library/bb175500.aspx
http://msdn.microsoft.com/en-us/library/bb207133.aspx
http://www.w3schools.com/html/default.asp
Also, you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top