URI Format

Is there any way I can open a word template using a URI? eg

Document mainDoc = word.Open("http://server/templates/template.doc");

Hi,

The way to do it is to use System.Net.WebRequest and WebResponse classes that represent .NET Framework’s request/response model for accessing data from the Internet.

However, there is a bit of trickery involved as it is important for the whole data to be fully downloaded before a Word file can be opened.

This sample code works:

System.Net.WebRequest request = System.Net.WebRequest.Create(@"http://www.hobbycity.co.nz/Soldat/TestMailMerge.doc");
System.Net.WebResponse response = request.GetResponse();

byte[] responseData = new byte[response.ContentLength];
int bytesRead = 0;
while (bytesRead < response.ContentLength)
{
    int bytesToRead = (int)response.ContentLength - bytesRead;
    bytesRead += response.GetResponseStream().Read(responseData, bytesRead, bytesToRead);
}
response.Close();

Word word = new Word();
Document doc = word.Open(new MemoryStream(responseData));

Hi All,

Is there a way to print the document without opening after it is downloaded?

Any early reply will be appreciated.

Thanks

Hi Umer,

Thanks for your inquiry. I have already answered your query here:
https://forum.aspose.com/t/22121

Please follow above thread for further proceedings. Thanks for your cooperation.