Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Feb 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inserting Pictures - unable to change folder (Word2003)

    I am inserting a large number of JPGs into Word documents. I do this using the "Insert/Picture/From File" menu.

    However, when I choose "Insert/Picture/From File", the folder always changes back to the system folder. Each time I insert a picture I have to spend a lot of time navigating to the correct folder.

    The "Tools/Options/File Locations/Clipart Pictures" will not modify the default path, and I cannot change it using VBA code to set "options.DefaultFilePath(wdPicturesPath)". I think the system settings have been locked.

    Has anyone got a suggestion as to how I can set the path by creating a macro? I have tried using the Application.Dialogs(wdDialogInsertPicture), but it doesn't appear to let me set the file path.

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

    Re: Inserting Pictures - unable to change folder (Word2003)

    Welcome (back?) to Woody's Lounge!

    I'm using Word 2002 (aka XP).
    <UL><LI>If I switch to a different folder while selecting a picture in Insert | Picture | From File..., Word "remembers" this during the session. After quitting and restarting Word, it uses the default path again.
    <LI>If I change the clipart path in the File Locations tab of Tools | Options..., Word will use that path as default in Insert | Picture | From File...
    <LI>I can also set the clipart path using VBA:

    Options.DefaultFilePath(wdPicturesPath) = "C:Piccies"[/list]If all these don't work for you, it looks like something is interfering. Try Phil Rabichow's <!post=Systematic Approach to Behavioral Problems in Word,197827>Systematic Approach to Behavioral Problems in Word<!/post> to see if you can find the culprit.

  3. #3
    New Lounger
    Join Date
    Feb 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting Pictures - unable to change folder (Word2003)

    Hi Hans

    Thanks for welcoming me back!
    The system here has been locked down and won't allow me to change the picture path using these options (options.defaultfilepath, or filelocations tab). All I can do is try to find a workaround.

    Do you know if there is a way to set the picture path using the VBA code to open the dialog box: application.Dialogs(wdDialogInsertPicture)? Some of the old postings had a .path property for this dialog box- but I can't seem to be able to set it in Word 2003.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Inserting Pictures - unable to change folder (Word2003)

    System folder -- like "My Pictures"? If the path is consistent, you can create a shortcut there to the desired folder and double-click it. No macro magic required. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    For Application.Dialogs(wdDialogInsertPicture), did you try setting .Name = c:somepath*.jpg just before .Show?

    If you want to continue to experiment with macros, does ChangeFileOpenDirectory have any effect on that dialog? (It might only affect the File Open dialog.)

  5. #5
    New Lounger
    Join Date
    Feb 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting Pictures - unable to change folder (Word2003)

    If it would be possible to create a shortcut in Word to that folder to insert pictures from, then that would be great. The reason I need to use Word's "Insert/ Picture/ From File" is because it pastes the picture into the document the smallest size. If I use "Paste" or "Paste special" then the documents are larger in size.

    When I try to set the path using application.Dialogs(wdDialogInsertPicture).Name = c:somepath*.jpg , I get the error message:
    Runtime error '438', Object doesn't support this property or method.

    You are quite right that the ChangeFileOpenDirectory only affects the File/Open dialog box.

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

    Re: Inserting Pictures - unable to change folder (Word2003)

    If setting the DefaultFilePath doesn't work, you could try the following macro. It is much more limited than the wdDialogInsertPicture dialog, but perhaps you can use it:
    <code>
    Sub InsertPic()
    With Application.FileDialog(msoFileDialogOpen)
    .Filters.Clear
    .Filters.Add "Image files", "*.bmp;*.gif;*.jpg;*.png"
    .Filters.Add "All files", "*.*"
    ' Folder to start in
    .InitialFileName = "C:Piccies"
    If .Show Then
    Selection.InlineShapes.AddPicture .SelectedItems(1)
    End If
    End With
    End Sub</code>

  7. #7
    New Lounger
    Join Date
    Feb 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting Pictures - unable to change folder (Word2003)

    Thank you. That works perfectly and will save me a lot of time <img src=/S/blowup.gif border=0 alt=blowup width=60 height=60>

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Inserting Pictures - unable to change folder (Word2003)

    <hr>If it would be possible to create a shortcut in Word to that folder to insert pictures from, then that would be great.<hr>
    In case you need it, I meant a shortcut in the default folder that you can double-click to navigate to the desired target folder. Standard Windows shortcut, not Word-specific.

Posting Permissions

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