Here’re the codes:
Dim filePathName, progid As String
Dim MyDir As String = “C:\VS2012”
Dim doc As New Aspose.Words.Document(MyDir + “inFile.docx”)
Dim docBuilder As DocumentBuilder = New DocumentBuilder(doc)
filePathName = MyDir + “MyPPTTestFile.ppt”
progid = “PowerPoint.Show.8”
Using stream As New MemoryStream(File.ReadAllBytes(filePathName))
docBuilder.InsertOleObject(stream, progid, True, Nothing)
End Using
Dim dataDir As String = “C:\VS2012\outFileWithPPTAttachment.docx”
’ Save the document to disk.
doc.Save(dataDir)
I generate a cover letter with header and footer.
At the end of header, I set the page break
docBuilder.InsertBreak(BreakType.SectionBreakContinuous)
I got this error :
Cannot insert the requested break outside of the main story
I have a datatable and want to export it to the excel file.
Can I do that with Aspose.WORD ?
thanks
Hi,
I had a special pdf file with all formats as a form, I want to read it, populate data from Oracle database and insert video such as .wmv, .mp3, .mp4 files to this pdf file.
is it possible? if so, please provide VB.net examples .
thanks
Hi,
Thanks for contacting support.
Aspose.PDF for .NET offers the feature to create as well as fill PDF forms. You can read data from database and use it to fill PDF form. Please take a look over following code snippets.
VB,NET code to Fill Form Fields
’Open document
Dim pdfDocument As Document = New Document("FillFormField.pdf")
' Get a field
Dim textBoxField As Aspose.Pdf.Forms.TextBoxField = pdfDocument.Form("textbox1") As Aspose.Pdf.Forms.TextBoxFieldTextBoxField
' Modify field value
textBoxField.Value = "Value to be filled in the field"
' Save updated document
pdfDocument.Save("c:/pdftest/FilledForm.pdf")
VB.NET code to Add attachment to PDF file
’ file attachment annotation, using DOM
Dim doc As Aspose.Pdf.Document = New Aspose.Pdf.Document("c:/pdftest/MarginsPdf.pdf")
' get instance of first page of the document
Dim firstPage As Aspose.Pdf.Page = doc.Pages(1)
' create FileSpecification objecgt
Dim fs As Aspose.Pdf.FileSpecification = New Aspose.Pdf.FileSpecification("C:\IF Pull 3-1-2017.mp4", "MP4")
' create File Attachment Annotation object
Dim fileAnnot As Aspose.Pdf.Annotations.FileAttachmentAnnotation = New Aspose.Pdf.Annotations.FileAttachmentAnnotation(firstPage, New Aspose.Pdf.Rectangle(0, 0, 100, 100), fs)
' add annotation to annotations collection of PDF file
firstPage.Annotations.Add(fileAnnot)
' save PDF document
doc.Save("c:/pdftest/MarginsPdf_mp4.pdf")
The issues you have found earlier (filed as WORDSNET-14001) have been fixed in this Aspose.Words for .NET 22.11 update also available on NuGet.