Solved

insert image into HTML signature

Posted on 2009-05-03
6
1,320 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

813 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