Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2020, 07:34 PM
mikbro1215 mikbro1215 is offline Changing Link on Audio Files on Startup Windows 10 Changing Link on Audio Files on Startup Office 2016
Novice
Changing Link on Audio Files on Startup
 
Join Date: Mar 2020
Posts: 3
mikbro1215 is on a distinguished road
Default Changing Link on Audio Files on Startup


Hi,
I have a folder full of docm files which contain linked audio files which are in a sub-folder (linked because I modify the audio relatively frequently and some files are in multiple documents). I would like to move this folder about: among friends.
I would like to have a script run on opening the document that updates these links to match where the folder is moved to.

So far all I know is that I should be running Document_Open() and that ActiveDocument.Path gets the path for the document I want. I have no Idea how to count how many linked audio files there are and I don't know how to refer to any specific file either to access their properties. I don't even know what they are. Are they fields? Are they Shapes? Is there just a generic object?

Thanks for any help at all, this is my first time using VBA and I've been trying to figure this out for two days now.
Reply With Quote
  #2  
Old 03-11-2020, 08:25 PM
Guessed's Avatar
Guessed Guessed is offline Changing Link on Audio Files on Startup Windows 10 Changing Link on Audio Files on Startup Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

We don't know how you have created the links to the audio files. Either post a sample doc containing at least one of your links or describe fully the method you use to create the link in a document.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 03-11-2020, 08:50 PM
mikbro1215 mikbro1215 is offline Changing Link on Audio Files on Startup Windows 10 Changing Link on Audio Files on Startup Office 2016
Novice
Changing Link on Audio Files on Startup
 
Join Date: Mar 2020
Posts: 3
mikbro1215 is on a distinguished road
Default

Thank you, I did not know it mattered. It was via insert, object, create from file, clicking the link to file checkbox. The files were either mp3 or m3u files which referred to mp3's in the same folder.
Reply With Quote
  #4  
Old 03-12-2020, 12:44 AM
macropod's Avatar
macropod macropod is offline Changing Link on Audio Files on Startup Windows 7 64bit Changing Link on Audio Files on Startup Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What you're trying to do is not possible with Word VBA, since the use an EMBED field and the most Word returns is the field code: 'EMBED Package'. No details about the filename or its path can be retrieved. Even if you Activate it via .OLEFormat.Activate, all that does is start the file playing but without revealing any of the details you're interested in.

To see what would be involved in doing this programmatically, see: Word - Embedded Object of type "Package", especially paras 1 & 6-10 of the post marked as the Answer.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-12-2020, 07:23 AM
mikbro1215 mikbro1215 is offline Changing Link on Audio Files on Startup Windows 10 Changing Link on Audio Files on Startup Office 2016
Novice
Changing Link on Audio Files on Startup
 
Join Date: Mar 2020
Posts: 3
mikbro1215 is on a distinguished road
Default

Thank you, but is there some work around possible? What I want is to be able to change the content of the audio files and move the folder around and not have the links break. Is that possible?
Like is it possible for me to write a script for each document to find them all and delete them and then recreate them upon opening the file.
Reply With Quote
  #6  
Old 03-12-2020, 01:45 PM
macropod's Avatar
macropod macropod is offline Changing Link on Audio Files on Startup Windows 7 64bit Changing Link on Audio Files on Startup Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The only workaround to what's described in the link I posted would be to actually embed the files in the document rather than link them.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Link on Audio Files on Startup How to embed audio (not link) in PP2013? Melody PowerPoint 4 12-29-2018 12:53 PM
changing link sources in excel-2010 files mhagi Excel Programming 5 01-31-2017 03:38 AM
Changing Link on Audio Files on Startup Batch create word files with link to changing excel hannes.ledegen Mail Merge 8 04-07-2016 01:22 AM
msw 2007 ver 12-how do i create a audio link? ss1133 Office 0 03-27-2012 09:07 AM
Changing Link on Audio Files on Startup PPT 2010 will only insert, not link to audio files. kevin3d PowerPoint 1 10-07-2011 09:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft