Free Support Forum - aspose.com

ASPOSE 8 and Date Docvariables format

Hi,

In ASPOSE 8 date formatting does not work. In ASPOSE 7 this feature was working correctly.

The code is:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim objDoc As New Document("C:\before.doc")
Dim strValor As String
Dim strFecha As String
Dim strTipo As String
Dim strCodDateCo As String

System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("es-ES")

Try

objDoc.Variables.Item("VFECSOLIC") = Date.Today
objDoc.Variables.Item("VFPRIMERPAGO") = "15/11/2009"
objDoc.UpdateFields()

objDoc.Save("C:\after.doc")

Catch ex As Exception

strValor = "0"

End Try

objDoc = Nothing

End Sub

Hi

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

Thanks for your request. I cannot reproduce the problem on my side. I use the following code for testing:

CultureInfo curentCulture = Thread.CurrentThread.CurrentCulture;

Thread.CurrentThread.CurrentCulture = new CultureInfo("es-ES");

// Create document.

Document doc = new Document(@"C:\Temp\in.doc");

doc.Variables["VFECSOLIC"] = DateTime.Today.ToShortDateString();

doc.Variables["VFPRIMERPAGO"] = "15/11/2009";

doc.UpdateFields();

// Save output docuemnt.

doc.Save(@"C:\Temp\out.doc");

doc.Save(@"C:\Temp\out.xml");

Thread.CurrentThread.CurrentCulture = curentCulture;

Best regards,

I have executed your code in ASPOSE8 NET2.0 version in Visual Studio 2005 and it works correctly but when I have tried to execute the SAME code in ASPOSE8 NET1.1 it doesn't work.

Try to execute your code in Visual Studio 2003 with ASPOSE8 NET1.1...

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

Thank you for additional information. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards,

The issues you have found earlier (filed as 11419) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(71)