+ Reply to Thread
Results 1 to 5 of 5

Create and Save a new word document from user form

  1. #1
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Create and Save a new word document from user form

    Hello once again,

    This project is creating a database in Excel and then opening a Word Template to paste data. I am using Excel to track Engineering Change Requests, the Word document is then a paper copy of each request and related information from the user form.

    So far I have the code opening the word template working, it's trying to SaveAs I've not got worked out. This is a little tricky (for me at least) in that I am giving the file path of where to save, then literal text "ECR-" and concatenate the value of a text box on the user form.

    The result I am after is: ECR-1003, where 1003 is the auto-assigned number for the record that is in the user form textbox. The text box is Locked to prevent accidental changes.

    The code here is what I have. Just haven't quite got the save as syntax right.

    Thank you in advance for any assistance.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Create and Save a new word document from user form

    Try this
    Please Login or Register  to view this content.
    I always add the extension, too.
    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Re: Create and Save a new word document from user form

    Thanks Tinbendr, I'll give it a go after awhile.

    Not sure what the ",51" is doing but it will be interesting to find out.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Create and Save a new word document from user form

    You can define what word file format to save it as. 51 means the default setting.

  5. #5
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Re: Create and Save a new word document from user form

    Tinbendr,

    Your suggestion makes the process work. I'm guessing this is a version specific issue but I had to use the .SaveAs and not include the , 51 to make it work on my system. I am still stuck on 2007 versions of MS Office until I upgrade.

    Now that this is working I can continue adding code to actually move data into the Word document.

    My guess is that I will be back with questions about that!

    For a second time, at least, you have gotten me on the right path.

    Thank You

+ 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. open, edit, and save a word document based on user response in excel 2010 VBA
    By cmccabe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2016, 03:13 PM
  2. User form to create PDF document
    By kor123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2016, 11:47 PM
  3. VBA - Create Word Document or Edit Document if exists
    By unstable81 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-11-2013, 08:27 AM
  4. Add text to Existing Word Document if it Doesn't exist create Word Document
    By unstable81 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-10-2013, 12:15 AM
  5. View Word Document on User Form?
    By nevi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2012, 02:53 PM
  6. Replies: 0
    Last Post: 06-15-2011, 02:22 PM
  7. Replies: 5
    Last Post: 10-01-2008, 08:30 AM

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