+ Reply to Thread
Results 1 to 3 of 3

open a new word document

  1. #1
    Ciara
    Guest

    open a new word document

    hello,

    I have a spread sheet with various options. when i have completed these
    options I want to be able to press a 'quote' button which will open up a word
    document and put these results in a simple easy to read format.

    Problem 1 - I can't get excel to open a new word document

    Problem 2 - Whats the best way to copy the information across? Should I
    make up the sentances in Excel first and then just copy and paste them?

    Thanks,

  2. #2
    Registered User
    Join Date
    02-05-2005
    Posts
    57
    I assume you want to use macro to gather info and populate a word doc?

    if so, I would use the following to open word (u need to have word already open):

    Sub address()

    Set wrd = GetObject(, "Word.Application")
    (I set this at the top of my code)

    then when you have collected all the info (in this case assume you have collected a name & address and are inputting it onto a template):

    wrd.ChangeFileOpenDirectory _
    "\\INPUT THE DRIVE HERE\INPUT THE DIRECTORY HERE"
    wrd.Documents.Open FileName:="INPUT THE NAME OF DOC U WANT TO OPEN HERE.doc", ReadOnly:=True, AddToRecentFiles:=False

    WordArray = Array(Addressline1, addressline2, addressline3, postcode)

    wrd.ActiveDocument.Fields(1).Select
    With wrd.Selection
    .InsertAfter Text:=Name
    End With

    For wrdroutine = 0 To 2
    wrd.Selection.NextField.Select
    With wrd.Selection
    .InsertAfter Text:=WordArray(wrdroutine)
    End With
    Next

    msgbox ("all done!")

    end sub

    If this is what you are looking for, let me know and I will talk you through it

  3. #3
    Ciara
    Guest

    RE: open a new word document

    Managed to get it to open now - how do I get it to save the word file as the
    name given in a particular cell?

    "Ciara" wrote:

    > hello,
    >
    > I have a spread sheet with various options. when i have completed these
    > options I want to be able to press a 'quote' button which will open up a word
    > document and put these results in a simple easy to read format.
    >
    > Problem 1 - I can't get excel to open a new word document
    >
    > Problem 2 - Whats the best way to copy the information across? Should I
    > make up the sentances in Excel first and then just copy and paste them?
    >
    > Thanks,


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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