Try:
<img src="http://www.website.com/path/to/image.jpg" width="width_in_points" height="height_in_points" style="width:width_in_poits;height:height_in_points;" />
For a complete example:
<img src="http://www.website.com/path/to/image.jpg" width="233" height="54" style="width:233pt;height:54pt;" />
I am not very familiar with VML and embed images in Word, but as it seems to me, this is suitable for my purposes and I can embed it in a Word document. Word will automatically handle the attachment on first boot.
Just keep in mind that the default dimension in Word is both centimeters and dots, so you need to do all this with glasses. Probably a good way is to insert the image first, open it in Word, resize it if you need, and get the image dimensions through the word. Then go back to your application and set the width and height. Try to keep the same ratio as Word, otherwise it will resize your image. At least what the Word does to me.
EDIT:
I reviewed the example image above - it works with some versions of the word, but does not insert the image. You will receive warnings every time you open a file asking you if you want to download an external file. If your office security settings prevent you from doing this, you need to insert the file using the first answer that I confirmed for working with office 2007 +:
<div style='mso-element:header' id=h1 > <span style='mso-no-proof:yes'> <!--[if gte vml 1]> <v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path=" m@4 @ 5l@4 @ 11@9 @ 11@9 @5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"/> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"/> <v:f eqn="sum @0 1 0"/> <v:f eqn="sum 0 0 @1"/> <v:f eqn="prod @2 1 2"/> <v:f eqn="prod @3 21600 pixelWidth"/> <v:f eqn="prod @3 21600 pixelHeight"/> <v:f eqn="sum @0 0 1"/> <v:f eqn="prod @6 1 2"/> <v:f eqn="prod @7 21600 pixelWidth"/> <v:f eqn="sum @8 21600 0"/> <v:f eqn="prod @7 21600 pixelHeight"/> <v:f eqn="sum @10 21600 0"/> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/> <o:lock v:ext="edit" aspectratio="t"/> </v:shapetype> <v:shape id="_x0000_s1025" type="#_x0000_t75" alt="" style='position:absolute; margin-left:0;margin-top:2pt;width:537pt;height:57pt;z-index:251659264'> <v:imagedata src="http://www.website.com.au/path/to/image.jpg"/> <w:wrap type="square"/> </v:shape> <![endif]--> </span> </div>
Put this in the section:
<style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);}
Just make sure all your measurements are in points.
source share