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

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

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

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 ?

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

MAYDAY, MAYDAY .... help me please, I'm in deep trouble here !

What is wrong ?

Best regards
KeldSor
Aarhus V, Denmark

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

If you send me a copy of one of the documents so that I can see exactly what you have in it,, referencing this thread in the covering email message, I will investigate the issue.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Come on now ... I've given you the way to generate a simple sample document !!

It's not the test I'm seaking help for ... it's these Runtime error 91 I describe - never mind the test. I'll find it myself.

Best regards
KeldSor
Aarhus V, Denmark

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Come on now ... I've given you the way to generate a simple sample document !!

It's not the test I'm seaking help for ... it's these Runtime error 91 I describe - never mind the test. I'll find it myself.

If you want a quick solution, send volunteer expert Doug Robbins a sample of the problem document. You are working with volunteers here. Don't ask them to jump through hoops to help you.

You already have the problem file or can follow your own directions. This is not a lot to ask.

If you want, you can simply save a copy without proprietary or confidential information on OneDrive or DropBox and post a link here.

Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Listen ... it's NOT a problematic document ... there is NOTHING more than the "link" in the document ... nothing else !!!

I'm sure if I send the document , the next question would be "How did you create the "link" ?

... and that's exactly what I describe in my posting - to creation the document takes 30 seconds ... be reasonable !

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

What shall I do instead ?
Best regards
KeldSor
Aarhus V, Denmark

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Reply In reply to deleted message

There was a similar problem with me when I was creating a doc file related to electric smokers :/ looking for some useful solutions. This is really stressful.

Is this an add or ...

If not - what was the solution ?

Best regards
KeldSor
Aarhus V, Denmark

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

It seems like Word sees it as a TYPE is EMBEDDED and it's NOT it's chained ... but there is NO constant for that !

Is something missing here ?

Best regards
KeldSor
Aarhus V, Denmark

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

It is with YOUR document that you have the problem.  I do not have any problem with my documents.

But if you don't want my help, in spite of your pleas, that's OK with me.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

OK, then it must be WORD that is failing - because every document I create with a chained "link" have that problem.

I'll make a document and a video file, save them on OneDrive and give you a link here:

https://1drv.ms/u/s!Ap0XTBN0ykvEhq1kJ1WhLJRMm7K-zg?e=44aYEr

Hope you find out how !

Best regards
KeldSor
Aarhus V, Denmark

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Use the following code:

Dim alink As Hyperlink
For Each alink In ActiveDocument.Hyperlinks
    alink.Range.Copy
    alink.Range.Paste
    MsgBox alink.Address
Next

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Question Info


Last updated October 5, 2021 Views 101 Applies to: