PDA

View Full Version : refer to sound file in same directory as word file



chodkinson
10-17-2011, 04:10 PM
Hi Guys,

I'm trying to play a sound which is contained in the same folder as my word document. I have managed to do it by entering the full path in the vb code. However i want to copy the files to a different pc so the path i have specified will therefore change. Basically i just want to refer to the file which will be in the same directory as the word file. Any help would be appreciated.

Thanks

Christian

macropod
10-18-2011, 04:24 AM
hi Christian,

You can retrieve the document's path with code like:
ActiveDocument.Path
If you use that as a variable, it'll be available for pointing to the sound file.