Consulting

Results 1 to 18 of 18

Thread: What does word use to identify different pages within the document?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Mar 2023
    Posts
    28
    Location

    What does word use to identify different pages within the document?

    I am making a sheet in excel with VBA where I can add pages by using a listbox which populates with all open documents in word. Once I have this nailed down I will be making a header type bar where I can add signature boxes and textboxes to drag and drop over the top of documents. Basically this will be a 'Docusign' copy as my company is quite frugal and prefers to be innovative.

    Ideally I would have a browse function to add the pages but this didn't work that well in practice.

    The code I have so far will, in an excel workbook, when pressing a commandbutton - open a userform with a listbox, contained in the listbox is all the open documents in word. Once double clicked, it will port over into a new excel sheet, the whole document as paste.special, a picture.

    This works fantastic, until I am faced with a multiple sheet document, and the code will only port over the first page. Nomatter how hard I try, it doesn't seem to be able to identify the different pages. Currently the code uses .wholestory but I need this to be subjective to the document. I've tried to get VBA to identify the page breaks and then loop through until the end of the document but this just only pulled the footer etc.

    Its worth noting as well that our company will refuse to use acrobat or any 3rd party software so can't use this within the coding.

    If it is a single page, then .wholestory will suffice. However if it has multiple pages, I need to generate a new page in excel and then copy each page into the new sheet.

    I have attached the workbook for your perusal. Sometimes you have to close all instances of word running in the system memory as the listbox picks up old documents.

    If anybody could help me transfer each page from the document to a new sheet in excel then I would be massively appreciative!
    Attached Files Attached Files
    Last edited by ecalid; 10-23-2023 at 05:49 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •