Hi Vitaly,
one of the bookmarks that had text changed is Nationality another is LanguageDescription -as well as that some of the statis text in the table such as "XXX Consulting" and "Main RD YYY" has changed from Times-Roman 11 to Times-Roman 10.
Sample of code where the bookmarks have bene linked with available data fields and a sql statement is run for each bookmark to find the table/column/data type it has to retrieve data for. The GetText function etc just return strings in required format.
It has all worked fine for several other templates which makes me think that they have done something to the formatting of this one but I cannot see what. Any help would be much appreciated.
There is other code which goes through tables that have multiple rows and copies the table and then replaces the bookmarks as many times as there are rows of data however the code to do that isn't needed in this example as I cut the template down.
thanks
Simon
....
Dim oDoc As New Aspose.Words.Document(sTemplateName.ToString)
Dim bookmarks As Aspose.Words.Bookmarks = oDoc.Range.Bookmarks
Dim bookmark As Aspose.Words.Bookmark
-- parse sql statement here
For Each bookmark In bookmarks
Dim objConn As New SqlConnection(connString.ConnectionString)
Dim objCommand As New SqlCommand(sql, objConn)
Dim rs As SqlDataReader
objCommand.Parameters.Add("@TemplateID", SqlDbType.Int).Value = nTemplateID
objCommand.Parameters.Add("@WordTemplate", SqlDbType.VarChar).Value = bookmark.Name
objConn.Open()
rs = objCommand.ExecuteReader()
If rs.Read Then
Select Case rs("FieldTypeID")
Case 1
bookmark.Text = GetText(nStaffID, nTemplateID, rs("TableName"), rs("ColumnName"))
Case 2
bookmark.Text = GetBulletedText(nStaffID, nTemplateID, rs("TableName"), rs("ColumnName"))
Case 5
bookmark.Text = GetDate(nStaffID, nTemplateID, rs("TableName"), rs("ColumnName"), rs("DateFormat"))
Case 6
bookmark.Text = GetMultilineText(nStaffID, nTemplateID, rs("TableName"), rs("ColumnName"))
Case 7
bookmark.Text = GetCSVText(nStaffID, nTemplateID, rs("TableName"), rs("ColumnName"))
Case Else
bookmark.Text = GetText(nStaffID, nTemplateID, rs("TableName"), rs("ColumnName"))
End Select
End If