I found a similar reference in the forum that suggesting using
- Code: Select all
document.IsUpdateFields = True
, but when I call SavetoFile with that option set as True, I get the following error:
StartIndex cannot be less than zero.
Parameter name: startIndex
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex
Source Error:
Line 221:
Line 222: Dim strCompletedFileName As String = grdLoans.SelectedDataKey.Value.ToString() & "##" & strTemplateName
Line 223: oDocument.SaveToFile(Request.PhysicalApplicationPath & "CRM\MergeDocs\TempMergeFiles\" & strCompletedFileName & ".docx")
Line 224:
Line 225:
[ArgumentOutOfRangeException: StartIndex cannot be less than zero.
Parameter name: startIndex]
System.String.Remove(Int32 startIndex) +11690962
Spire.Doc.Fields.Field.ᜆ() +673
Spire.Doc.Fields.Field.Spire.Doc.Layout.IDocumentWidget.Measure(spr₶ dc) +9407
sprⁱ.ᜀ(RectangleF A_0) +395
sprᥢ.ᜃ(spr⊐ A_0) +699
sprᥢ.ᜀ(RectangleF A_0) +1215
sprḱ.ᜃ(spr⊐ A_0) +2591
sprᥢ.ᜀ(RectangleF A_0) +1215
sprᥢ.ᜃ(spr⊐ A_0) +699
sprᥢ.ᜀ(RectangleF A_0) +1215
sprᥢ.ᜃ(spr⊐ A_0) +699
sprᥢ.ᜀ(RectangleF A_0) +1215
sprហ.ᜀ(spr A_0, sprẘ A_1, spr₶ A_2) +757
sprᲦ.᜔() +1085
sprᲦ.ᜀ(Document A_0) +206
Spire.Doc.Document.ᜱ() +111
Spire.Doc.Document.ᝉ() +77
Spire.Doc.Document.SaveToFile(String fileName, FileFormat fileFormat) +298
Spire.Doc.Document.SaveToFile(String fileName) +111
Loan_List.lnkLoans_Docs_Click(Object sender, EventArgs e) in C:\Users\David\Dropbox (SoundEquity)\Sound Equity\Technology\WebSite-v6_Zoho\Loans\LoanList.aspx.vb:223
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +116
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +106
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9752530
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3562