+ Reply to Thread
Results 1 to 4 of 4

Printing of several Word files by specifying only the beginning of the ".doc" name

  1. #1
    Registered User
    Join Date
    05-27-2021
    Location
    Strasbourg, France
    MS-Off Ver
    2010
    Posts
    28

    Thumbs up Printing of several Word files by specifying only the beginning of the ".doc" name

    Hello everyone,

    I am desperately trying to run the code below.

    When I want to run the macro I get an error code "5151" that tells me that the program cannot find the file.

    My problem is the following, I would like to print the two word files in one program and indicating only the beginning of the file name (FMON027 and FMON036).

    Thank you in advance for your help!!!

    Sincerely

    Benten667

    Please Login or Register  to view this content.
    Last edited by Benten667; 02-27-2023 at 03:26 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,027

    Re: Printing of several words by specifying only the beginning of the ".doc" name

    Open won't work with wildcards.

    If there is more than one file that matches the beginning of the file name, this code will only print the first one. You said "two Word files" so I assume there will only be one file for each prefix.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,119

    Re: Printing of several Word files by specifying only the beginning of the ".doc" name

    Here's an alternative that will print multiple matches.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-27-2021
    Location
    Strasbourg, France
    MS-Off Ver
    2010
    Posts
    28

    Re: Printing of several Word files by specifying only the beginning of the ".doc" name

    Hello to both of you,

    I would like to thank you sincerely for the answers you have given me, the two codes allow me to unblock situations I encountered.

    This forum is a mine of information and saves precious time thanks to your contribution.

    I wish you a nice day and an excellent week.

    Benten667

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 10
    Last Post: 03-25-2020, 01:16 PM
  2. [SOLVED] Sort words between strings "Start" and "End"
    By jokris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2016, 01:31 PM
  3. How to count the words "true" and "false"?
    By tukae in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-09-2015, 03:19 AM
  4. If cell contains "word" then replace with "these words"
    By yellow281 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2013, 07:19 PM
  5. Replies: 10
    Last Post: 01-26-2012, 08:26 AM
  6. Words in a list beginning with a letter "C"
    By jimwilliams in forum Excel General
    Replies: 2
    Last Post: 03-04-2009, 08:56 AM
  7. Remove "TRUE" "FALSE" words from a linked checkbox
    By MDCK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2008, 03:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1