+ Reply to Thread
Results 1 to 7 of 7

Open word file from userform with folder and file names as per textbox values

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Open word file from userform with folder and file names as per textbox values

    Hi all,
    I am trying the following:
    1. Open a word document from userform
    2. name of folder is as per textybox2 and file will be as per textbox1

    Following code will take as far as general folder, but unable to go any further.

    Please Login or Register  to view this content.

    Code in userform1
    Please Login or Register  to view this content.
    I have attached the file.
    Kindly double click the reference number in column A in sheet1 to open userform

    Need to open folder in your c drive as 123456, 1234Z, 1234X
    Some docm files , two in the name of F1, F2

    Need some help here please
    Thanksd team
    Kind regards

    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Open word file from userform with folder and file names as per textbox values

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Open word file from userform with folder and file names as per textbox values

    Hi AlphaFrog Sir,
    First of all thank you very much.
    The first part of code works well. Great
    The second part has some challanges.
    It does not open file if the textbox value is matched with word file name.
    But manually if I click that file, it it will.
    Please Login or Register  to view this content.
    Ideally I plan to open word file in that folder where folder and file name is matched.
    And the userform closes.

    Any guidance please?

    Kind regs

  4. #4
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Open word file from userform with folder and file names as per textbox values

    Hi AlphaFrog Sir,
    First of all thank you very much.
    The first part of code works well. Great
    The second part has some challanges.
    It does not open file if the textbox value is matched with word file name.
    But manually if I click that file, it it will.
    Please Login or Register  to view this content.
    Ideally I plan to open word file in that folder where folder and file name is matched.
    And the userform closes.

    Any guidance please?

    Kind regs

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Open word file from userform with folder and file names as per textbox values

    Quote Originally Posted by KK1234 View Post
    It does not open file if the textbox value is matched with word file name.
    But manually if I click that file, it it will.
    I don't know what that means.


    Is this what you want...
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 07-14-2015 at 11:36 AM.

  6. #6
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Open word file from userform with folder and file names as per textbox values

    Hi Sir,
    Perfect . I was exactly trying to achieve it.
    Really thanks for your kind help.
    I am now closing this one as solved.
    Once again very grateful indeed.
    Kind regs

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Open word file from userform with folder and file names as per textbox values

    You're welcome. Thanks for the feedback.

+ 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. Marco to Open all contents (.xlsm) in a folder and search each file for a word
    By Mr.Post in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-11-2014, 04:08 PM
  2. [SOLVED] Can not open word, pdf file from userform
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-02-2014, 01:44 AM
  3. Replies: 15
    Last Post: 08-27-2012, 10:13 AM
  4. [SOLVED] Macro to copy file names and data from each file in a folder into master spreadsheet
    By dee1989 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-10-2012, 05:52 AM
  5. Replies: 0
    Last Post: 08-21-2011, 07:38 AM
  6. Printing word document from full file path in textbox in userform
    By pharmsunil2010 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2010, 05:37 AM
  7. Replies: 7
    Last Post: 04-15-2006, 04:20 PM

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