I have an existing template. The TOC has a Heading 1 (Executive Summary), then another Heading 1 (Your Business Resource). I insert two templates under the second Heading 1 . Each template includes a Heading 3 that are numbered 1.1.1 and when aspose creates the doc, they still reflect 1.1.1 however they should get updated to this:
1 Executive Summary
2 Your Business Resource
2.1.1 Expedited ParcelCan you provide an example in VB.Net (ASP.Net)?
2.1.2 Regular Parcel
Thanks!
Rob
01/15/2012 I have uploaded updated_toc.doc which is what it should look like (this file is slightly different). proposal.doc is the output generated by the code below via aspose.
This is what I have:
Dim dstDoc As New Document(Path.Combine(Request.PhysicalApplicationPath, “Documents\PDT.doc”))
Dim builder As New DocumentBuilder(dstDoc)
Dim srcDoc2 As New Document(Path.Combine(Request.PhysicalApplicationPath, “Documents\PD04-DOM-RegularParcel.doc”))
Dim srcDoc As New Document(Path.Combine(Request.PhysicalApplicationPath, “Documents\PD02-DOM-ExpeditedParcel.doc”))
‘’ Set the appended document to appear on the next page.
'Continuous tells word to append the new doc under a partial heading or paragraph
srcDoc.FirstSection.PageSetup.SectionStart = SectionStart.Continuous
srcDoc.FirstSection.PageSetup.RestartPageNumbering = False
dstDoc.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting)
srcDoc2.FirstSection.PageSetup.SectionStart = SectionStart.Continuous
srcDoc2.FirstSection.PageSetup.RestartPageNumbering = False
dstDoc.AppendDocument(srcDoc2, ImportFormatMode.KeepSourceFormatting)
'update proposal title
'Move the insertion cursor to a merge field.
builder.MoveToMergeField(“Proposal_Title”)
builder.Write(“Best Buy”)
'Foot_Proposal_Title
builder.MoveToMergeField(“Foot_Proposal_Title”)
builder.Write(“Best Buy Proposal”)
builder.MoveToMergeField(“Address”)
builder.Write(“123 Anywhere St”)
builder.MoveToMergeField(“City”)
builder.Write(“Any City”)
builder.MoveToMergeField(“Prov”)
builder.Write(“ON”)
builder.MoveToMergeField(“Postal”)
builder.Write(“K0G1T0”)
builder.MoveToMergeField(“C_Company”)
builder.Write(“Best Buy Ltd”)
dstDoc.UpdateFields()
dstDoc.UpdatePageLayout()
dstDoc.Save(Path.Combine(Request.PhysicalApplicationPath, “Documents\proposal.doc”))