Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Create-clickable-highlighted-text", "Create-clickable-highlighted-text\Create-clickable-highlighted-text.csproj", "{57C001A1-C538-4829-92C2-20D710656E0F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{57C001A1-C538-4829-92C2-20D710656E0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57C001A1-C538-4829-92C2-20D710656E0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57C001A1-C538-4829-92C2-20D710656E0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57C001A1-C538-4829-92C2-20D710656E0F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A30E106F-36D5-42A4-A44F-0AE880C0565D}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Create_clickable_highlighted_text</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using Syncfusion.DocIO;
using Syncfusion.DocIO.DLS;
using Syncfusion.Drawing;

//Create a new Word document
WordDocument document = new WordDocument();

// Add a section
IWSection section = document.AddSection();

// Add introductory paragraph
IWParagraph para = section.AddParagraph();
para.AppendText("Student Handbook\n\n");
para.AppendText("For attendance rules, see ");

// Add bookmark hyperlink
IWField hyperlink = para.AppendHyperlink("Attendance","Attendance Policy",HyperlinkType.Bookmark);

// Highlight the hyperlink text
WTextRange textRange =hyperlink.OwnerParagraph.ChildEntities[hyperlink.OwnerParagraph.ChildEntities.Count - 2] as WTextRange;

if (textRange != null)
{
textRange.CharacterFormat.HighlightColor = Color.Yellow;
}

para.AppendText(".");

// Add some content before the destination
section.AddParagraph().AppendText("Student Code of Conduct");
section.AddParagraph().AppendText("Examination Rules");
section.AddParagraph().AppendText("Library Guidelines");

// Add bookmark destination
IWParagraph destination = section.AddParagraph();
destination.AppendBookmarkStart("Attendance");
destination.AppendText("Attendance Policy");
destination.AppendBookmarkEnd("Attendance");

// Add attendance rules as bullet list
IWParagraph bullet1 = section.AddParagraph();
bullet1.ListFormat.ApplyDefBulletStyle();
bullet1.AppendText("Students must maintain at least 75% attendance.");

IWParagraph bullet2 = section.AddParagraph();
bullet2.ListFormat.ApplyDefBulletStyle();
bullet2.AppendText("Students should attend all mandatory classes.");

IWParagraph bullet3 = section.AddParagraph();
bullet3.ListFormat.ApplyDefBulletStyle();
bullet3.AppendText("Medical leave must be supported by valid documents.");

// Save document
document.Save(@"../../../Output/Output.docx", FormatType.Docx);

// Close document
document.Close();
Loading