Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need macro help - insert file (WordXP (2002))

    Am new Word user (moving from WP) and would appreciate help.

    Would like to create a macro that would display the "Insert File"
    dialog box displaying a directory other than the default doc
    directory. This is to allow the user to pick from a list of files
    kept in their own directory. This macro should not change the default
    document directory.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: need macro help - insert file (WordXP (2002))

    Welcome to Woody's Lounge!

    You can use a macro like this:

    Sub InsertFromFolder()
    Application.ChangeFileOpenDirectory "C:Word"
    Application.Dialogs(wdDialogInsertFile).Show
    End Sub

    Change C:Word to the folder you want to show.

  3. #3
    New Lounger
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: need macro help - insert file (WordXP (2002))

    Thank you! This is so different from PerfectScript, is going to take me a while to do even the simplest of things. (I hate not knowing how to make something do what I want it to do)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: need macro help - insert file (WordXP (2002))

    It's always difficult to switch from a system (PerfectScript in this case) you're familiar with to a new and unknown one, but you'll get used to it as you go along.

    Two tips:
    - Recording a macro (Tools | Macro | Record new macro) can give you a good idea of the objects, methods and properties used by Word.
    - Click in any word in the Visual Basic Editor (for example in a recorded macro) and press F1 to get help on that word.

  5. #5
    3 Star Lounger
    Join Date
    Aug 2004
    Posts
    361
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: need macro help - insert file (WordXP (2002))

    Is there a method to have all files show up in the particular folder? i know that it is only one click away to select all files which isn't taxing, but I would be interested in seeing the syntax to have it show all files.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: need macro help - insert file (WordXP (2002))

    Does this do what you want?

    With Application.Dialogs(wdDialogInsertFile)
    .Name = "*.*"
    .Show
    End With

  7. #7
    3 Star Lounger
    Join Date
    Aug 2004
    Posts
    361
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: need macro help - insert file (WordXP (2002))

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •