Free Support Forum - aspose.com

Hyperlinks in Aspose.Words Linq

Hi,

I am struggling a bit with trying to get Hyperlinks to work consistently. I have been using this link, but it doesn’t seem to explain things fully. https://forum.aspose.com/t/using-hyperlinks-within-linq/41148

I have attached the Word doc.HelloWorld.zip (9.9 KB)

Here is the code:

Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense(“Aspose.Total.lic”);

        // For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET
        // The path to the documents directory.
        string dataDir = @"D:\Data\Aspose Samples\Docs";
        string outDir = Path.Combine(dataDir, "Output");

        string fileName = "HelloWorld.docx";
        // Load the template document.
        Document doc = new Document(Path.Combine(dataDir,fileName));

        // Create an instance of sender class to set it's properties.
        Sender sender = new Sender { Name = "LINQ Reporting Engine", Message = "Hello World", Hyperlink1 = @"http://Aspose.com" };

        // Create a Reporting Engine.
        ReportingEngine engine = new ReportingEngine();

        // Execute the build report.
        engine.BuildReport(doc, sender, "s");

        outDir = Path.Combine(outDir, fileName);

        // Save the finished document to disk.
        doc.Save(outDir);

Any assistance would be awesome.

Steve Grey

@stevegrey.global.co

Thanks for your inquiry. We are looking into the issue and will update you shortly.

@stevegrey.global.co

Thanks for your patience. Please find attached sample Template, it will help you to add hyperlink using Aspose.Word LINQ Reporting Engine.

HelloWorld.zip (9.8 KB)

HI there, thanks, this looks very good. Will test it tonight and let you know.

Thanks,

Steve

A post was split to a new topic: Add Hyperlink via LINQ Reporting Engine of Aspose.Words