+ Reply to Thread
Results 1 to 2 of 2

Print off the word document using excel vba code

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Print off the word document using excel vba code

    Hi there

    I have a userform and there is a textbox which ask the user to type the name of word document. I want to write the code so that when the user type the word document name and press print button then it should print off the word document which is stored in "J\ABC\xxx\Test" automatically. if that word file is not present in the folder mentioned then just display an error message "The file doesn't exist"

    I hope anyone can help me out in this.

    Thanks

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Print off the word document using excel vba code

    aman,

    create a module in your excel workbook and add the following code

    Please Login or Register  to view this content.
    add a button to the worksheet where the user will specify the document name and link the button to the above routine. In the example code provided change the cell reference to the one where the user will be specifying the document name
    If you like my contribution click the star icon!

+ 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. Need VBA code to select entire content of word document - excel related
    By derryt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2012, 07:33 AM
  2. VBA code from Excel to create and add info into a Word Document
    By Boitumelo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-07-2011, 05:15 AM
  3. excel vba code to export text to word protect document
    By rob bob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2010, 01:07 PM
  4. Replies: 0
    Last Post: 08-19-2009, 12:47 PM
  5. Code to copy Excel data to a Word document
    By Zimbo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-09-2009, 03: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