Solved

insert image into HTML signature

Posted on 2009-05-03
6
1,318 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn how to dynamically set the form action using jQuery.

914 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

14 Experts available now in Live!

Get 1:1 Help Now