We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Doc I/O cannot display DocVariable Value

Thread ID:

Created:

Updated:

Platform:

Replies:

88739 Aug 10,2009 07:23 PM UTC Aug 14,2009 12:41 PM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: DocIO
Vinod K Bobba
Asked On August 10, 2009 07:23 PM UTC


1) Not able to Access the DocVariable from Word document in my .cs file.


I looked at sample,

Created a DocVariable in my Word document....and later had this code in the .cs file.

WordDocument doc = new WordDocument();
doc.Open("Sample.doc");
DocVariables v = document1.Variables;
//Add a variable
v.Add("var1", "Author Name");
//Add / modify variables:
v["var2"] = "change name";
Console.WriteLine("Number of Variables:" + document1.Variables.Count.ToString());
Console.WriteLine("Variable Name:" + document1.Variables.GetNameByIndex(0));
Console.WriteLine("Varaible Value:" + document1.Variables.GetValueByIndex(0));

doc.Save("SampleModified.doc");

Now, I my problem was....I am not able to display the DocVariable value.


Vijayakumar S [Syncfusion]
Replied On August 11, 2009 12:10 PM UTC

Hi Vinod,

Thank you for posting your query.

While we would strongly recommend that you use Direct Trac because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time.

Could you please try this code snippet and let us know if this helps

WordDocument doc = new WordDocument();
doc.Open("Sample.docx", FormatType.Automatic);
DocVariables v = doc.Variables;
//Add a variable
v.Add("var1", "Author Name");
//Add / modify variables:
v["var2"] = "change name";
Console.WriteLine("Number of Variables:" + doc.Variables.Count.ToString());
Console.WriteLine("Variable Name:" + doc.Variables.GetNameByIndex(0));
Console.WriteLine("Varaible Value:" + doc.Variables.GetValueByIndex(0));

doc.Save("SampleModified.docx", FormatType.Docx);

Please let us know if you have any questions

Regards,
Vijay

Vinod K Bobba
Replied On August 14, 2009 12:06 AM UTC

Hi Vijay,

That's exactly what I was doing, but the DocVariable value is only displayed when I right click on the variable and click edit field.

I tried to use macro to update the field and it works.


But the problem is, When I have the DocVariable nested in a Table, it doesn't work.

Let me know if you have any suggestions.


Vijayakumar S [Syncfusion]
Replied On August 14, 2009 12:41 PM UTC

Hi Vinod,

Thank you for your update.

We were able to see the mentioned issue. We have forwarded this issue to our development team for further analysis. Could you please report this issue through Direct Trac Developer Support System https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. Thank you for your participation in Syncfusion’s Community Forums”.

Please let us know if you have any questions.

Regards,
Vijay

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;