Outlook VBA insert URL not working -


i can insert manually picture outlook 2010 new email using "insert picture" , “insert link file” feature. in file field enter link: http://www.example.com/image.php?s1=song1.net & c1=composer

the link returns image , can see in body of email.

i need enter url using vba. wrote code below , not work. when tried run came following message: run-time error ‘4198’: command failed. highlights line includes link.

my code:

sub inserthtmlfile() dim insp inspector set insp = activeinspector if insp.iswordmail dim worddoc word.document set worddoc = insp.wordeditor worddoc.application.selection.insertfile "http://www.example.com/image.php?s1=song1.net & c1=composer ", , false, false,   false end if end sub 

i appreciate if can show me how can use vba insert image did manually. unfortunately outlook not have macro recorder show me instructions how it.

try use %20 replace/encode spaces in url string.

also i'd suggest recording vba macro in word see exact line of code required job done using word object model. word provides macro recorder allows job manually , code generated in background. see record or run macro more information.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -