+ Reply to Thread
Results 1 to 7 of 7

Open a word doc, save as a text file, return to excel

  1. #1
    Registered User
    Join Date
    03-24-2020
    Location
    Devon
    MS-Off Ver
    Office365
    Posts
    3

    Open a word doc, save as a text file, return to excel

    Hi all,
    First of all apologies as i'm a complete newbie when it comes to VBA!
    Ok so i have a spreadsheet which imports the contents of a text file into the next row of an existing spreadsheet doc. I've got that all working fine, but the text file comes from a word form filled out by other users and currently i have to go in to the form and save it as a .txt file then come out and import it in to my spreadsheet.
    What I want to do is make this automated. The form itself will always have the same name and file location.
    So basically i need to:-
    Open Excel spreadsheet and run a macro which:-
    Opens a specific word document
    Saves that document to a specific location as a .txt file
    exits Word
    returns to Spreadsheet.

    I'm thinking this would be a sub routine so I can run this before i run my other subroutine to take the result and place it in my spreadsheet.

    I've tried doing this myself and can get a word doc to open but can't get the doc to save sensibly and in the right format.
    Any help would be appreciated.
    Thanks in advance.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Open a word doc, save as a text file, return to excel

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

    Please also post the code you have already created

  3. #3
    Registered User
    Join Date
    03-24-2020
    Location
    Devon
    MS-Off Ver
    Office365
    Posts
    3

    Re: Open a word doc, save as a text file, return to excel

    ok so this is how im opening the doc...
    Please Login or Register  to view this content.
    But i dont know where to go from here.
    Last edited by Pepe Le Mokko; 03-25-2020 at 09:12 AM.

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Open a word doc, save as a text file, return to excel

    Thanks
    In the future please wrap code with code tags. I did it for you this time

  5. #5
    Registered User
    Join Date
    03-24-2020
    Location
    Devon
    MS-Off Ver
    Office365
    Posts
    3

    Re: Open a word doc, save as a text file, return to excel

    Will do Pepe.
    Can anyone help with this?

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831
    (removed 'cause of wild cross-posting)
    Last edited by Marc L; 04-01-2020 at 05:17 PM.

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Open a word doc, save as a text file, return to excel

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    As you are new I will add it for you.Please read forum rules

    https://www.mrexcel.com/board/thread...macro.1129324/

+ 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. Excel VBA to open/save MS Word documents
    By Summer7 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2017, 10:59 AM
  2. [SOLVED] Word 2016 is default, but hyperlinks in Excel file open Word 2010
    By 6StringJazzer in forum Excel General
    Replies: 2
    Last Post: 11-29-2016, 11:29 PM
  3. Excel VBA to open Word doc, then populate, then Save it as PDF
    By graham726 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2016, 07:27 PM
  4. [SOLVED] Open MS Word Save Dialog From Excel VBA
    By Skins11 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2016, 02:27 PM
  5. How do I open, insert a table, save & close a word file via excel
    By partha.raha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2015, 12:40 AM
  6. Check if a Word File is Open and If Open Close it with Excel VBA.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2012, 11:14 AM
  7. Open and Save Word Documents via Excel
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-22-2010, 02:54 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