Solved

insert image into HTML signature

Posted on 2009-05-03
6
1,325 Views
Last Modified: 2013-11-19
I currently have a vbs script that queries the users AD account, then creates a html file for their outlook signature based on the AD data.

its all works peachy, now management want to ad a logo to the signature!! BEcause the script automatically creates the signature i have been trying for the life of me to add a new line to the script that inserts an image.

attached is the vbs that im using. If i open the html file and add in the the html part it works fine, however when i try and use this code in a vbs file it keeps giving me the following error

"Error: Expected end of statement"

i have compated it to my other objfile.write code and cant see where i am going wrong.



objfile.write "<br><img src="gptw.jpg" /></br>"

Open in new window

0
Comment
Question by:2bitpanther
  • 3
  • 2
6 Comments
 
LVL 13

Accepted Solution

by:
Brian Withun earned 125 total points
ID: 24292649
The HTML tag <BR> is a singleton tag, for one thing.

You can't do this:

<BR> text </BR>

BR only works this way:

<BR />

It creates a carriage return.

Maybe this misuse is creating your problem, or maybe it's the nested double-quotes.

try this instead:

objfile.write "<br /><img src=" & chr(34) & "gptw.jpg" & chr(34) & " /><br />"


objfile.write "<br /><img src=" & chr(34) & "gptw.jpg" & chr(34) & " /><br />"

Open in new window

0
 
LVL 17

Assisted Solution

by:NicksonKoh
NicksonKoh earned 125 total points
ID: 24292764
bhwithun suggestion should solve your problem. In any case, here's an alternative using 2 double quotes.

objfile.write "<br /><img src=""gptw.jpg"" /><br />"

Open in new window

0
 

Author Comment

by:2bitpanther
ID: 24300796
the script is running without any errors however its not inserting the picture.

when i edit the html file it supposed to be creating it doesnt insert the html code into the file
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:2bitpanther
ID: 24300812
sorry i shoudl have mentioned that i get the same result when use both code snippets you guys have provided
0
 
LVL 17

Expert Comment

by:NicksonKoh
ID: 24300817
Post the whole code. The error could be somewhere else.
0
 

Author Comment

by:2bitpanther
ID: 24300831
hey thanks for getting back to me, i realised why. I was placing the code in the wrong spot

the vbs cript creates and an email signature in html, rtf and plain text.

i realised that i put the code in the section where it creates the plain text signature, and moved to the section where it creates the html siganutre. my bad

but both of your suggestions worked and thanks again for your assistance
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn how to dynamically set the form action using jQuery.

828 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