none
How to find the PATH and FILENAME in inserted links in word documents ?? RRS feed

  • Question

  • No one seems to be able to guide me on here, so please help med solve that problem !

    In a mainfolder I have 1000's of word documents saved in a subfolder and 100's of MP4-video files in another subfolder in that same mainfolder.

    I have to test to see if all inserted "link" (with a path and file name in it) in each word document is found as a file among the video files in the subfolder mentioned abowe.

    I the longer run I want to change the PATH to the "links" in all the documents ... or change the path in the link, when the document is opened i Word, but ...

    Just to get started I did this:

    Create a new empty word document,

    click INSERT/OBJECT
    choose TAB "Create from file"
    check both checkboxes
    choose a MP4 video file
    click OK

    (My translations because I have WORD in a danish version !)

    Then save the document and go to the immidiate window and do this typing:

    ? ActiveDocument.InlineShapes.Count
    1

    ? ActiveDocument.InlineShapes.Item(1).Type=wdInlineShapeEmbeddedOLEObject
    True

    then I try this:
    ? ActiveDocument.InlineShapes.Item(1).LinkFormat.SourceFullName

    but it gives me error message. Runtime error 91 - Object variable not set

    What am I doing wrong here ?

    EDIT: It works fine IF the inserted "link" is to a word-document but Run timr Error 91 if it's a MP4 file !

    What shall I do instead ?




    • Edited by Ksor2 Friday, October 25, 2019 5:52 PM
    Thursday, October 24, 2019 10:52 AM

Answers

All replies