PC Review


Reply
Thread Tools Rate Thread

Access to Outlook Via Excel

 
 
Pradeep
Guest
Posts: n/a
 
      28th Aug 2008
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
 
Reply With Quote
 
 
 
 
dch3
Guest
Posts: n/a
 
      28th Aug 2008
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

"Pradeep" wrote:

> 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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Exporting from Outlook to excel and access Diane Poremsky [MVP] Microsoft Outlook Calendar 0 14th Sep 2009 02:34 PM
Re: Exporting from Outlook to excel and access Bob I Microsoft Outlook Calendar 0 14th Sep 2009 02:30 PM
how do i use outlook web access through excel? =?Utf-8?B?Q2hyaXMgV2lsZG1hbg==?= Microsoft Excel Programming 1 5th Jun 2006 11:54 AM
Using Excel Macros & Outlook Web Access =?Utf-8?B?TWlrZSBSLg==?= Microsoft Excel Programming 0 12th Mar 2005 06:01 PM
Re: Outlook Excel forms to Access John Nurick Microsoft Access External Data 0 16th Sep 2004 09:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:40 PM.