Solved

MS Access 2007 / MS SharePoint problem with Outlook e-mail

Posted on 2011-03-24
6
202 Views
Last Modified: 2012-05-11
I have recently split my MS Access database, with the backend being on SharePoint.  Everything seems to work really well.  Some minor issues, but no show stoppers.  Well, that's what I originally thought anyway.

Here's the problem:

I have a button on my MS Access form that takes the information from the fields on the Access form and creates a formatted e-mail message.  The VB code uses .HtmlBody for the body of the e-mail.  When I hit the button everything works perfectly.  The information is taken from the form and populated on to the Outlook e-mail just like it should; however, when I send the e-mail, all the data is stripped and left with some of the html formatting code.  It is very strange.  The information is there in the e-mail, but when I hit the send button, I look at the sent e-mail and the information is gone.

Even stranger is that the Subject line of the e-mail is unaffected.  It works perfectly fine.

If anyone has encountered this problem or can point me in the right direction I would be extremely thankful.
0
Comment
Question by:cgraziano
  • 3
6 Comments
 
LVL 84
ID: 35212386
How are you creating the .HTMLBody string? You should try building a Variable and using that:

Dim sBody As String

sBody = WhateverMethodYouUseToBuildHTMLBody

Now use the sBody variable instead of .HTMLBody
0
 

Author Comment

by:cgraziano
ID: 35212597
Thanks for the suggestion.  Unfortunatley, I will not have access to my database until tomorrow morning.  I will try this out first thing.

One question though.  I used .HtmlBody because I needed the e-mail to be formatted with bolding and underlining.  Will I be able to accomplish that using the sBody string method you mentioned?

But, how does this explain Outlook stripping the e-mail of all the information?  Like I said, the e-mail is created with all the appropriate data and in the correct format, but is blank after being sent.  I originally thought it was a Outlook problem, but then started to think it may have something to do with the SharePoint permissions.  I used the same exact code before I split the database between Access and SharePoint and everything worked fine.  The problem didn't start until I started using SharePoint as the backend.

I was also just thinking about playing with Outlooks external editor settings under the e-mail options, mail formatter.  Maybe switching it to use MS Word as the default e-mail editor for all new e-mails.  Any thoughts?

Thanks
0
 

Author Comment

by:cgraziano
ID: 35216902
Ok.  I found out what the problem was.  It has soemthing to do with the HTML message formatter.  When I switch the e-mail to Rich Text it is sent perfectly.  So, then I went and changed the Mail Format for the MS Outlook 2007 inbox from HTML to Rich Text, but when I use my Access form to create the e-mail it changes the message format back to HTML.  I think since I am using the .HtmlBody in the VB code it is automatically converting it back to HTML.  Rather than relying on the user to change the message format for every message, I would like to create a way to have it done automatically.  I can think of only two options:

Change the .HtmlBody in the VB code.  I tried using the sBody method suggested by LMS but it did not like the html code code used in the body, and produced a blank message.  Instead of using .HtmlBody or .Body is there a rich text version I could use?

Or, is there a code I code put at the end of the e-mail code that will automatically convert the e-mail to Rich Text after the information has been added to the e-mail?

Any suggestions would be very helpful.  

Thank you  
0
 

Author Comment

by:cgraziano
ID: 35217082
I ended up using a .BodyFormat = olFormatRichText at the end of my e-mail code to switch the e-mail back to Rich Text.  I have to do a little more testing to ensure none of the formatting was lost, but initial indications look good.
0
 

Accepted Solution

by:
ee_auto earned 0 total points
ID: 36260796
Question PAQ'd and stored in the solution database.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Outlook Free & Paid Tools
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

746 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now