Outlook Integration Subjects Missing from Text Messages (1 Viewer)

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
Emails that arrive from Text Messages display in Outlook properly. The subject is populated correctly.

But in neither the direct link to the Inbox, or using Outlook Automation, will populate the subject field in the table.

I was sure I had this working in Office 2013. Sadly other projects had priority, now in 2106 it no longer seems to work.

If you have any ideas I would sure appreciate it.
 

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
I looked at an old table and it appears that both the Subject and Body fields have always be blank.
 

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
The answer is weird.
I was viewing the table with one line displayed. It turns out the text was buried several lines down.

This is solvable by removing the leading spaces.
 

Cronk

Registered User.
Local time
Tomorrow, 07:04
Joined
Jul 4, 2013
Messages
2,348
Does that mean you have solved your problem?
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:04
Joined
Sep 21, 2011
Messages
5,708
Well I can understand some leading spaces in the body of the text, but the subject?
 

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
Does that mean you have solved your problem?
Yes and no.

I have been using VBA code to remove the line breaks, but I need to use HTML.
Got a little more work to do.
 

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
Ok new info:

What I'm doing is creating a new local record (Access) in a Long Text (Memo) field. It turns out that changing the field formatting to Rich Text eliminates the line feeds but leave a few spaces.
I'll try updating the record with the Trim() function on the table on the table after the Insert. We'll see

This seems to only happen on T Mobile, not Sprint.
I'm going to try Verizon next.
 

The_Doc_Man

Happy Retired Curmudgeon
Local time
Today, 16:04
Joined
Feb 28, 2001
Messages
16,793
If it is happening only on certain carriers then their default settings for browsers have something funky in them.
 

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
If it is happening only on certain carriers then their default settings for browsers have something funky in them.
I couldn't agree more.

The question is how to deal with this extra html code?

This might work if the code was VBA.

Code:
                    Do While Left(Mailobject.Body, 1) = Chr(13) Or Left(Mailobject.Body, 1) = Chr(10) Or Left(Mailobject.Body, 1) = ""
                        Mailobject.Body = Right(Mailobject.Body, Len(Mailobject.Body) - 1)
                  
                   Loop
Is there a way to strip html from the incoming email?
 

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
Using Mailobject.HTMLBody instead of Mailobject.Body to insert the record I get this

Debug.Print Mailobject.HTMLBody

Code:
<html><head><title>T-Mobile</title></head><body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" bgcolor="#ffffff"><table border="0" width="600" cellspacing="0" cellpadding="0"><tr>
                     <td width="600" colspan="2"><img src="cid:dottedline600.gif" width="600"></td>
                     </tr><br><tr><td width="600" colspan="2"><img src="cid:tmobilespace.gif" width="600" height="20"></td></tr><tr><tr><td colspan="1" align="left">Text TMobile</td></tr> <TR>
                <TD width=350 colSpan=1>
                <IMG src="cid:tmobilespace.gif" width="350" height="30">
                </TD>
                </TR>
                <TR>
                </TR>
                <td width="240" bgcolor="#f2f2f2">&nbsp;</td>
                </tr><tr><td width="600" colspan="2"><img src="cid:footer.gif" width="600" height="105"></td></tr></tr><tr><td width="600" colspan="2"><img src="cid:tmobilespace.gif" width="600" height="40"></td></tr></table></body>
</html>
The Field populates with this:

T-Mobile
Text TMobile

No spaces "Text TMobile" is the actual message, "T-Mobile" is what Doc was talking about the extra stuff. You can see it in the title above

Any solutions
 
Last edited:

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
I guess the solution (work around) is to insert it into a Rich Text field from this object Mailobject.HTMLBody.

It's not perfect, but better than a bunch of invisible hard to delete HTML.

If anyone has an idea of how to strip the HTML out, I definitely say thank you.
 

Cronk

Registered User.
Local time
Tomorrow, 07:04
Joined
Jul 4, 2013
Messages
2,348
Yes, use the PlainText method, then where the CR is and your text is the rest of the string. Something like
Rich (BB code):
str = olItem.HTMLbody
str = application.plainText
i = instr(str, vbcr)   '--i is length of the header line including LF,CR
strYourExtractedText = mid(str,i+1)
 

Cronk

Registered User.
Local time
Tomorrow, 07:04
Joined
Jul 4, 2013
Messages
2,348
Eureka, I've found how to color sections of code. In the code window, for the Language, click the drop down, upper right and select Rich code. Or am I the sucker being the only one who did not know this.
 

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
If it is happening only on certain carriers then their default settings for browsers have something funky in them.
It's worse then that.
Verizon and T Mobile have a Text file with the plain text. this is good for either Android or I Phone
Sprint:
Android Good the .Body object has no extra code.
I Phone Bad: Adds extra I Phone BS It will probably need to be specifically deleted.

In case anyone is feeling bored, and wants to have a tech fight. Overall, I hate anything Apple.
 
Last edited:

strive4peace

AWF VIP
Local time
Today, 16:04
Joined
Apr 3, 2020
Messages
482
PlainText is used like a function

Code:
PlainText ("<b>text</b>") = "text"
 

Thales750

Formerly Jsanders
Local time
Today, 17:04
Joined
Dec 20, 2007
Messages
1,702
PlainText is used like a function

Code:
PlainText ("<b>text</b>") = "text"
Correct.
And this is what you have to do to remove I Phone Title:

Expr1: PlainText([otBodyPlain]) Removes HTML
Expr2: Replace([Expr1],"Sent from my mobile. _____________________________________________________________ ","") Removes I Phone Title
Expr3: Trim([Expr2]) Removes leading Spaces left over.

Hope they don't change to Title any time soon.

In most cases the standard HTML tag is removed from the .Body Object in Outlook, but when there is Title Text, it obviously doesn't remove that.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom