Solved

insert image into HTML signature

Posted on 2009-05-03
6
1,312 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Syntax Error 6 30
HTML Lists 3 29
How to Chain multiple custom filters with AngualrJS 3 11
Bootstrap 3 application structure 7 14
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.
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.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

705 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

22 Experts available now in Live!

Get 1:1 Help Now