#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
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.
|
#4
|
||||
|
||||
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] |
#5
|
|||
|
|||
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. |
#6
|
||||
|
||||
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] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
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 |
PPT 2010 will only insert, not link to audio files. | kevin3d | PowerPoint | 1 | 10-07-2011 09:17 PM |