Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

insert image into HTML signature

Posted on 2009-05-03
6
Medium Priority
?
1,358 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 500 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 500 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Suggested Courses

886 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