change name of all page in once from notepad

2 situations.

1. can we change a document all pages name in once from notepaf?

notepad has 1st line become corel first page name

notepad has 2nd line become corel second page name

and so on etc?

2. can we create a 3 alphabet index from corel page name or notepad or excel. they shouldnt repeat once they wrote.

Parents
  • paraggoyal said:

    1. can we change a document all pages name in once from notepaf?

    notepad has 1st line become corel first page name

    notepad has 2nd line become corel second page name

    and so on etc?

    You can put text into CorelDRAW and then use the paragraphs for page names.

    Sub text_paras_to_pagenames()
    Dim sr1 As ShapeRange
    Dim para_count As Long
    Dim counter_1 As Long

        Optimization = True
        EventsEnabled = False
        On Error GoTo ErrHandler
           
        Set sr1 = ActiveSelectionRange.Shapes.FindShapes(, cdrTextShape)
        
        If sr1.Count = 0 Then
            MsgBox "No text objects are selected."
        Else
            If sr1.Count > 1 Then
                MsgBox "More than one text object is selected."
            Else
                para_count = sr1(1).Text.Story.Paragraphs.Count
                If para_count > ActiveDocument.Pages.Count Then
                    MsgBox "The number of paragraphs in the text shape (" & para_count & ") is more than the number of pages (" & ActiveDocument.Pages.Count & ") in the document."
                Else
                    For counter_1 = 1 To para_count
                        ActiveDocument.Pages(counter_1).Name = sr1(1).Text.Story.Paragraphs(counter_1)
                    Next counter_1
                End If
            End If
        End If

    ExitSub:
        Optimization = False
        EventsEnabled = True
        Application.Refresh
        Exit Sub

    ErrHandler:
        MsgBox "Error occurred: " & Err.Description
        Resume ExitSub
    End Sub

     


     


     

     

Reply Children
No Data