
Organizing information in a clear and structured way is essential when taking notes. You can make your notes easier to read by adding bulleted or numbered lists in OneNote. Lists help organize ideas, break down tasks, and highlight important points. They improve the structure of your notes and make it easier to scan the content. In this article, you will learn how to add and customize bulleted and numbered lists in OneNote using Java. We will also explore how to structure your content programmatically.
Ten artykuł porusza następujące tematy:
- C# OneNote SDK do tworzenia listy wypunktowanej lub numerowanej w OneNote
- Utwórz listę punktowaną w OneNote przy użyciu C#
- Stwórz listę numerowaną w OneNote za pomocą C#
- Wstaw chińską listę numerów do OneNote.
- Darmowe zasoby
C# OneNote SDK do tworzenia list z punktami lub numerowanych list w OneNote
Będziemy używać Aspose.Note for .NET do tworzenia list punktowanych lub numerowanych w dokumentach OneNote. To potężna biblioteka, która upraszcza proces tworzenia list punktowanych i numerowanych w OneNote. Oferuje solidne funkcje do manipulowania plikami OneNote, w tym dodawania, edytowania i formatowania list. Dzięki Aspose.Note programiści mogą łatwo zintegrować funkcjonalności OneNote do swoich aplikacji, co czyni ją cennym narzędziem dla programistów C#.
Postępuj zgodnie z tymi prostymi krokami, aby zainstalować Aspose.Note for .NET:
- Pobierz bibliotekę z releases.
- Zainstaluj to z NuGet używając następującego polecenia w konsoli menedżera pakietów:
PM> Install-Package Aspose.Note
Stwórz listę punktowaną w OneNote za pomocą C#
Proszę wykonać następujące kroki, aby stworzyć listę punktowaną w OneNote za pomocą C# z Aspose.Note for .NET:
- Utwórz nowy obiekt klasy
Document
. - Zainicjalizuj obiekty klas
Page
iOutline
. - Zainicjalizuj obiekt klasy
TextStyle
i ustaw właściwości formatowania. - Utwórz obiekty klasy
OutlineElement
i zastosuj punkty. - Dodaj elementy zarysu do
Outline
za pomocą metodyAppendChildLast()
. - Podobnie, dodaj
Outline
doPage
, a następniePage
doDocument
. - Zapisz dokument OneNote za pomocą metody
Save()
.
Proszę znaleźć poniżej kompletny fragment kodu C# demonstrujący te kroki:
using Aspose.Note;
// Utwórz obiekt klasy Document
Document doc = new Document();
// Zainicjalizuj obiekt klasy Page
Page page = new Page();
// Zainicjalizuj obiekt klasy Outline
Outline outline = new Outline();
// Zainicjuj obiekt klasy TextStyle i ustaw właściwości formatowania.
ParagraphStyle defaultStyle = new ParagraphStyle
{
FontColor = Color.Black,
FontName = "Arial",
FontSize = 10
};
// Zainicjuj obiekty klasy OutlineElement i zastosuj punkty.
OutlineElement outlineElem1 = new OutlineElement()
{
NumberList = new NumberList("*", "Arial", 10)
};
// Zainicjalizuj obiekt klasy RichText i zastosuj styl tekstu
RichText text1 = new RichText()
{
Text = "First",
ParagraphStyle = defaultStyle
};
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement()
{
NumberList = new NumberList("*", "Arial", 10)
};
RichText text2 = new RichText()
{
Text = "Second",
ParagraphStyle = defaultStyle
};
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement()
{
NumberList = new NumberList("*", "Arial", 10)
};
RichText text3 = new RichText()
{
Text = "Third",
ParagraphStyle = defaultStyle
};
outlineElem3.AppendChildLast(text3);
// Dodaj elementy zarysu
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
// Dodaj węzeł zarysu
page.AppendChildLast(outline);
// Add Page node
doc.AppendChildLast(page);
// Zapisz dokument OneNote
doc.Save("ApplyBulletsOnText.one");

Utwórz listę punktowaną w OneNote za pomocą C#
Utwórz numerowaną listę w OneNote za pomocą C#
Postępuj zgodnie z tymi samymi krokami, które wspomniano wcześniej, aby wstawić numerowaną listę w OneNote. Użyj jednak {0})
, aby zdefiniować format numeru (np. 1)
, 2)
, itd.) zamiast symbolu punktu jak ``.
Poniżej znajduje się kompletny przykład kodu C#, który demonstruje, jak zastosować numerację do tekstu.
using Aspose.Note;
// Utwórz obiekt klasy Document
Document doc = new Document();
// Zainicjuj obiekt klasy Page
Aspose.Note.Page page = new Page();
// Zainicjuj obiekt klasy Outline
Outline outline = new Outline();
// Zainicjalizuj obiekt klasy TextStyle i ustaw właściwości formatowania.
ParagraphStyle defaultStyle = new ParagraphStyle
{
FontColor = Color.Black,
FontName = "Arial",
FontSize = 10
};
// Zainicjalizuj obiekty klasy OutlineElement i zastosuj numerację
// Numery w tej samej strukturze są automatycznie inkrementowane.
OutlineElement outlineElem1 = new OutlineElement()
{
NumberList = new NumberList("{0}",
NumberFormat.DecimalNumbers, "Arial", 10)
};
RichText text1 = new RichText()
{
Text = "First",
ParagraphStyle = defaultStyle
};
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement()
{
NumberList = new NumberList("{0}",
NumberFormat.DecimalNumbers, "Arial", 10)
};
RichText text2 = new RichText()
{
Text = "Second",
ParagraphStyle = defaultStyle
};
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement()
{
NumberList = new NumberList("{0}",
NumberFormat.DecimalNumbers, "Arial", 10)
};
RichText text3 = new RichText()
{
Text = "Third",
ParagraphStyle = defaultStyle
};
outlineElem3.AppendChildLast(text3);
// Dodaj elementy zarysu
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
// Dodaj węzeł konturu
page.AppendChildLast(outline);
// Dodaj węzeł strony
doc.AppendChildLast(page);
// Zapisz dokument OneNote
doc.Save("ApplyNumberingOnText.one");

Utwórz numerowaną listę w OneNote za pomocą C#
Wstaw chińską listę numerów w OneNote
Proszę postępować zgodnie z wcześniejszymi krokami, aby wstawić chińską listę numerowaną w OneNote za pomocą Aspose.Note for .NET. Jednak użyj {0})
z NumberFormat.ChineseCounting
, aby zdefiniować format numerów.
Oto fragment kodu C#, który demonstruje, jak zastosować chińską listę numerowaną:
using Aspose.Note;
Document doc = new Document();
Page page = new Page();
Outline outline = new Outline();
// Zastosuj ustawienia stylu tekstu
ParagraphStyle defaultStyle = new ParagraphStyle
{
FontColor = Color.Black,
FontName = "Arial",
FontSize = 10
};
// Numery w tej samej strukturze są automatycznie zwiększane.
OutlineElement outlineElem1 = new OutlineElement()
{
NumberList = new NumberList("{0}",
NumberFormat.ChineseCounting, "Arial", 10)
};
RichText text1 = new RichText()
{
Text = "First", ParagraphStyle = defaultStyle
};
outlineElem1.AppendChildLast(text1);
OutlineElement outlineElem2 = new OutlineElement()
{
NumberList = new NumberList("{0}",
NumberFormat.ChineseCounting, "Arial", 10)
};
RichText text2 = new RichText()
{
Text = "Second",
ParagraphStyle = defaultStyle
};
outlineElem2.AppendChildLast(text2);
OutlineElement outlineElem3 = new OutlineElement()
{
NumberList = new NumberList("{0}",
NumberFormat.ChineseCounting, "Arial", 10)
};
RichText text3 = new RichText()
{
Text = "Third",
ParagraphStyle = defaultStyle
};
outlineElem3.AppendChildLast(text3);
outline.AppendChildLast(outlineElem1);
outline.AppendChildLast(outlineElem2);
outline.AppendChildLast(outlineElem3);
page.AppendChildLast(outline);
doc.AppendChildLast(page);
// Zapisz dokument OneNote
doc.Save("ChineseNumberList.one");

Wstaw chińską listę numerów w OneNote
Odbierz darmową licencję
Zainteresowany eksplorowaniem produktów Aspose? Odwiedź license page, aby uzyskać bezpłatną tymczasową licencję. Łatwo można zacząć, a Ty możesz odblokować pełny potencjał Aspose.Note dla swoich projektów!
Zastosuj punktorowanie lub numerację na tekście: Darmowe zasoby
Oprócz stosowania punktów lub numerowania w tekstach w dokumentach OneNote, oferujemy różne zasoby, aby pomóc w zrozumieniu Aspose.Note for .NET. Odwiedź naszą dokumentację i samouczki, aby uzyskać więcej informacji.
Wnioski
W tym wpisie na blogu omówiliśmy, jak tworzyć listy punktowane i numerowane w OneNote za pomocą C#. Dzięki Aspose.Note for .NET deweloperzy mogą wdrażać tę funkcjonalność w sposób efektywny, co pozwala im wzbogacić swoje aplikacje o uporządkowane i dobrze sformatowane treści notatek.
Jeśli masz jakiekolwiek pytania lub potrzebujesz dalszej pomocy, nie wahaj się skontaktować z nami na naszym free support forum.