How do I redirect a remote IP to a local IP to stop "contacting the server" errors in Word?
Neither setting Word to display images only as placeholders, nor putting the document view into Draft mode, solves the problem. It still tries to "Contact the server" with the consequent delay.
While trying to solve this, I discovered (by opening the docx in a Zip programme and searching through the various XML files inside) that the picture references are of the following 3 forms:
<Relationship Id="xyz123" Type="http://schemas.openxmlformats.org/... Target="file:///\\Server\Images\xxx.png" TargetMode="External"/>
<Relationship Id="xyz124" Type="http://schemas.openxmlformats.org/... Target="file:///S:\Images\xxx.png" TargetMode="External"/>
<Relationship Id="xyz125" Type="http://schemas.openxmlformats.org/... Target="file:///\\10.2.3.4\Images\xxx.pn... TargetMode="External"/>
Editing the HOSTS file and appending "127.0.0.1 Server" seems to improve the problem with the first type. Using "SUBST S: C:\" from a command prompt may improve the problem with the second type; the results are not yet conclusive. However, I'm not sure how to approach the third type. Some ideas I've had so far:
- Append "127.0.0.1 10.2.3.4" to the HOSTS file (but I think it's only used with names, right?)
- Use something like port forwarding in the router (but it's a simple Linksys WAG200G and I think it can only forward ports to IPs, not outgoing IP requests to IPs?)
- Use a firewall (ZoneAlarm is installed) to set up an custom rule that all outgoing requests to 10.2.3.4 are redirected to 127.0.0.1 (but I think all the expert rules offer is 'blocking' and a quick trial indicates that this doesn't solve the delay)
- Extract the whole docx to XML, edit the XML manually to replace all of the server references to something like C:\1\, C:\2\ and C:\3\, recompile into docx, edit the file then reverse the procedure just before sending the file back to the client (rather long winded)
Incidentally, "http://schemas.openxmlformats.org/offic... does not appear to be a valid URL, although a comment at http://www.docx4java.org/forums/pptx-java-f14/missing-host-for-schemas-openxmlformats-org-t378.html implies that this is not a problem because it's just a URI and not intended to be accessed online. I'm not 100% sure though.
Does anyone have any further suggestions for how I could try to resolve this situation?