Free Support Forum - aspose.com

insertField issue in Office 2003 cannot load data

Dear Support:

i am using builder.insertField to put field code: LINK Excel.Sheet.8 into word, but doesn't work.

code

string fieldCode = "LINK Excel.Sheet.8 \"C:\\\\temp\\\\Book1.xls\" \"Sheet1!R1C1:R1C3\" \\a \\p";

builder.InsertField(fieldCode, "");

anything wrong? thanks for your help

Hi

Thanks for your inquiry. I tried the following simple code and all works fine.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

string fieldCode = "LINK Excel.Sheet.8 C:\\\\Temp\\\\test.xls";

builder.InsertField(fieldCode, "");

doc.Save(@"Test020\out.doc");

You just should update fields in the document (Ctrl+A and then F9). Aspose.Words does not update LINK fields.

Best regards.

your are the best!,

thanks btw, do you know how to setup word to update automatically, thanks

Hi

Thanks for your inquiry. As workaround you can use a macro to automatically update fields. See the following link for more information.

http://support.microsoft.com/kb/832897

I hope this could help.

Best regards.

thanks for your replay, i found that if i do copy and paste in word, the field will automatically update, but if use Aspose i need to do Ctrl A and F9 then the field get updated, i am not sure if word doesn't recognize insertField in the beginning ... if Aspose can do exectly like word does will be great.

thanks

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Unfortunately Aspose.Words can’t update fields automatically. At the moment Aspose.Words can update the results of DOCPROPERTY and DOCVARIABLE fields only. For more information see FAQ.

Best regards.