Link to home
Start Free TrialLog in
Avatar of simonprr
simonprr

asked on

Outlook FLASHING Signature

I use Microsoft Outlook 98 and got one of my mates to write me a bit of code some that my name could flash in my messages, because I have enabled HTML message format. He gave me the following:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
</HEAD>
<BODY><BR>
<P><FONT color=#ff0000 face=Tahoma size=2>Regards</FONT> </P><SPAN id=ME
style="COLOR: black; FONT-FAMILY: Tahoma; FONT-SIZE: smaller; FONT-WEIGHT: bolder">Simon
<BR><BR>LAN Support MFD &amp; FRD Chatham</SPAN> <FONT color=#ff0000 face=Tahoma
size=2><BR>(01634) 111111 <BR><A href="mailto:myemailaddress@mywork.com"
style="COLOR: red">myemailaddress@mywork.com</A>
<SCRIPT language=JavaScript><!--
var iTimer=null

function flashName(){
if(ME.style.color=="black"){
      ME.style.color="red"
      }
else
      {
      ME.style.color="black"
      }
}
flashName();
iTimer = window.setInterval("flashName()",1000);

function unloadEvent(){
//alert("BYE!")
}

function loadEvent(){
//alert("Read it!")
}
//--></SCRIPT>
 </FONT></BODY></HTML>

Which worked great. Except for one thing. I have Outlook inserting my signature every time I create an a new message, reply to a message, forward a message. Sometimes, after people have replied to my messages a few times, and messages have gone backwards and forwards, it comes up with a Internet Explorer style error saying something like 'me.style.color is not an object'.

Now I went back to the guy who wrote the code for me and he said this:

"It is because the area of the text which flashes is identified as SGML by using an ID in the SPAN tag.  When you include your signature more than once on a page, the SGML ID is duplicated, so it becomes an array, which needs to be referenced by original position to uniquely identify the specific area you want to call.  So, the answer is to either add some array handling code, or just don't ever put your signature on any message more than once."

I don't want to only put my signature in a message ONLY once, so does anyone know how to do what he's talking about?? Or how to fix this??

Cheers.

SI
--
P.S. Sorry I couldn't offer more points, but I'm getting a bit short of them!
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Hmm - people who sends messages with flashing signatures DESERVES having me.style.color not an object errors

Am I glad I user messenge and can turn javascript off in messages (which kills stylesheets)

Michel
Avatar of simonprr
simonprr

ASKER

Well thats helpful! CHEERS!

not.
Will this be ok? Only the newest one blinks

function flashName() {
   if (Idocument.all) return; // only do it in IE
   if (document.all.ME(0).style.color=="black") {
      document.all.ME(0).style.color="red"
   }
   else {
      document.all.ME(0).style.color="black"
   }
}


Michel
Sorry - hit the wrong key
 if (Idocument.all) return; // only do it in IE

should be
 if (!document.all) return; // only do it in IE
Could you post the whole code again, including your amendments so that I know exactly where to put it and so that I can just copy and paste it to test it.

Cheers.
Well I've just tried it, as below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
</HEAD>
<BODY><BR>
<P><FONT color=#ff0000 face=Tahoma size=2>Regards</FONT> </P><SPAN id=ME
style="COLOR: black; FONT-FAMILY: Tahoma; FONT-SIZE: smaller; FONT-WEIGHT: bolder">Simon
<BR><BR>LAN Support MFD &amp; FRD Chatham</SPAN> <FONT color=#ff0000 face=Tahoma
size=2><BR>(01634) 392547 <BR><A href="mailto:Simon.Ratcliff@Lloyds.Com"
style="COLOR: red">Simon.Ratcliff@Lloyds.Com</A>
<SCRIPT language=JavaScript><!--
var iTimer=null

function flashName() {
   if (!document.all) return; // only do it in IE
   if (document.all.ME(0).style.color=="black") {
      document.all.ME(0).style.color="red"
   }
   else {
      document.all.ME(0).style.color="black"
   }
}

flashName();
iTimer = window.setInterval("flashName()",1000);

function unloadEvent(){
//alert("BYEBYEBYE!")
}

function loadEvent(){
//alert("Read it, maaaan!")
}
//--></SCRIPT>
 </FONT></BODY></HTML>

And the error is:

'object doesn't support this property or method'

Whats wrong?
Sorry, my fault for not testing with only one ;-)

This one works with one or more sigs

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
</HEAD>
<BODY><BR>
<P><FONT color=#ff0000 face=Tahoma size=2>Regards</FONT></P>
<SPAN id="ME" style="COLOR: black; FONT-FAMILY: Tahoma; FONT-SIZE: smaller; FONT-WEIGHT: bolder">Simon <BR><BR>LAN Support MFD &amp; FRD Chatham</SPAN> <FONT color=#ff0000 face=Tahoma size=2><BR>(01634) 392547 <BR><A href="mailto:Simon.Ratcliff@Lloyds.Com" style="COLOR: red">Simon.Ratcliff@Lloyds.Com</A>
<SCRIPT language=JavaScript><!--
var iTimer=null;

function flashName() {
   if (!document.all) return; // only do it in IE
   if (document.all.ME.length >0) obj = document.all.ME(0);
   else obj = document.all.ME;
   if (obj.style.color=="black")
      obj.style.color="red";
   else
      obj.style.color="black";
}

flashName();
iTimer = window.setInterval("flashName()",1000);

function unloadEvent(){
//alert("BYEBYEBYE!")
}

function loadEvent(){
//alert("Read it, maaaan!")
}
//--></SCRIPT>
 </FONT></BODY></HTML>

Michel
Well, that was very close, but now I get this error after about 4 replies backwards and forwards:

line 64
char 4
'obj.style.color is not an object'

Plus I had to change this bit from:

   if (document.all.ME.length >0) obj = document.all.ME(0);

to:


   if (document.all.ME.length >1000) obj = document.all.ME(0);

otherwise the flashing is almost impossible to see, after the second reply - the first is ok.
The length has nothing to do with the speed, only the number of spans called ME

Michel
I have no problems with 25 copies in IE - perhaps it is an outlook problem???

Michel
Does anyone else read these javascript questions???

Normally yes - perhaps they think it is too long a discussion.

Michel
I know that this will work using HTML on a Netscape Browser:
<blink>[NAME]</blink>.  [NAME] stands for your name.  If it doesn't work then I will tell you a way to have it scroll across as long as you give me the points because I'm a bit short on them also.  I just signed up and you're the first person I'm answering.
Well, I don't need this to work in a netscape browser!!

I need it too work in my outlook 98 messages, which it still isn't.

The reason I think it's NOT working is something to do with the actual message text which is being typed in to my messages are they go back and forth between me and someone, this must be the reason why it is causing the error:

line 64
char 4
'obj.style.color is not an object'

mplungjan, you said that you have put 25 copies in internet explorer. Well try putting some TEXT in between them and see if you get the error.

lakehmm, you said your short of points, well if i did accept you answer they would go into your 'expert points' and u can't use these for anything. They are just to show how good u are u see. You need more 'spendable' points, try going to the bit which is called 'earn more points'.
Simon: Sorry, my PC is on the blink right now and I am using a colleague's
I will try later...

LakeHmm: If you just signed on, please hang around and learn the ropes.
If you read the comments on this question and see the complexity of the rejected answer you should think that <BLINK> is not really an answer that would help Simon ;-)

Michel
LakeHmm,

The other thing is that you should always first post comments instead of answers because it locks the question.
I'm rejecting your suggestion for the time being, and when the correct comment is posted I will 'accept as answer'. As this question could last a bit longer till my problem is sorted.

Ok cheers.
Does anyone else every read javascript questions apart from 2 people?????!!!

Please help if u can.

Cheers.
A lot of people read the javascript questions. I can imagine that this one is a bit too far out to be looked at since I have suggested a solution that I doubt can be improved upon unless someone has a very good knowledge of how the DOM in outlook is put together...

Michel
Can't you help anymore then?
I wouldn't recommend answering this question to anyone because if it gets rejected (which it probably will be) he will chew you out and get all mad at you in a bad attitude.
Hmm - not a good grading history, simon...

I like Abba but not if it comes on Dcc ;-)

Michel
Well I'm only honest!! If you not honest about if the answer truely answers the question, then whats the point????

What do you mean 'dcc'??

Does this mean your not going to help anymore?
Your last 10 grades given was B D C C A C A B B A

I prefer to have my answers rejected rather than a C.

I mostly get A's because my answers work - I would not want them accepted if they did not work ;-)

I just asked EE to not allow a C grade in the Accept Comment as an answer for the same reason.

It is not that I do not want to help you, I do not believe I can help you further if what I have suggested so far does not work.

If you want this question reevaluated, try posting a 0 point question with a link to this since it has scrolled off the visible list.

If not, delete it or have Customer Services save it as a PAQ

Michel
That isn't that bad!

If maybe you visit some of those other questions and have a look at them you will understand WHY I have been FAIR in my GRADING!!

I was going to give you an A anyway, because your suggestions were almost right anyway.

WHAT IS THE POINT OF GIVING SOMEONE ANY A GRADE, IF THERE ANSWER DOES FIX THE PROBLEM OR ANSWER THE QUESTION, BUT IS NOT THE BEST WAY OF DOING IT OR IS JUST THE MOST ONLY SUITABLE WAY?? THE POINT OF THE GRADES IS TO SHOW HOW GOOD THE ANSWER IS. IT WOULD NOT HELP NEW USERS SEEING SOMEONE HAD GIVEN THE ANSWER AN A GRADE WHEN REALLY IT'S ONLY A WORK AROUND OR TEMPORARY FIX.
That is ok - I was not trying to make you give me points or anything like that. I just wondered aloud. What I meant was that in javascript anyway, I do not see C grades, because it either works or not. If it does not work, then I do not want the points unless the answer is "It cannot be done"

Sorry if I offended you...

Michel
Yes, well that make sense in the Javascript and NT (for examples) sections. But I spend a lot of time in the Hot URLs section and that is where it apply's most of time.
I can't say that you are being nice to the people around here, but here goes.

A signature in Outlook may only be 4K big. Also the HTML code int Outlook has a limitation (dunno how much Kb though). So, since the signature is at the end of the file, it won't be shown
Ah - so if the SIG is chopped in memory it might be visible, but the script cannot find it...

Perhaps if one was to use two sigs, one with the script and one with the div and only include the script one once...

Michel
What do you mean?:

'I can't say that you are being nice to the people around here, but here goes.'

me and mplungjan just had a *discussion* about grades. Whats wrong with that?
mplungjan,

I'm confused by your last comment, can you post what you mean in code please?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Still can't get it to work...
Sorry to hear it. I did not have too high a hope from the beginning...
Probably the closed I'm going to get!
Thanks.

Michel