We help IT Professionals succeed at work.

how to embed dynamic object in Word - from a CGI [web] service

Hi all,
I am looking for how I might go about embedding in Word (or excel, etc) the dynamic results from calling a "web service" that returns an image.

In other words, when you call this service (CGI) it returns an image
of "Content-type: image/png\n"

From within a web page - I can simply refer to the CGI script by using <img src =>  like so
<img src="../cgi-bin/test8.py" />

Which rns and returns the image.

However, I am at a loss for how I might accomplish this same thing, such that when a user refreshes a document, it makes the same call for this service to return a new/current image.

Any thoughts ?

Thanks !

Watch Question

Top Expert 2013

to execute the cgi you have to go through the web server and that requires an HTTP transaction.  Word cannot natively issue an HTTP request.  so it would need an object or plugin.  

I generally try to avoid the Microsoft trash but you would have to have something, an object perhaps in VBA:

Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
' the url will almost certainly have to be fully qualified
MyRequest.Open "GET", _"http://www.domain.com/cgi-bin/test8.py"
MsgBox MyRequest.ResponseText

Open in new window

That is nothing but a guess. I have no idea how to interface word with such an object, and if it does not work, I have no place to go with it.  It is, at best, a shot in the dark but I don't like to see questions sit in my topics without some kind of response from an Expert; though in this case I am not much of an expert for the kind of technology you need.


This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.