PDA

View Full Version : Retaining doc path when opening in HTML



nymnyi
03-20-2007, 09:13 AM
I created an AutoRun macro in a Word document that, among other things, uses ActiveDocument.Path to determine the doc location so it can use this to reference an Access db stored in the same folder. Works great. Problem is that I wanted to open the Word doc from an HTML page (currently using the window.open('worddoc.doc') command). When I do this, and the Word doc opens in the browser window, it no longer retrieves the original folder location -- it returns a null value -- so the Access database cannot be found.

Is there a way to retain this VBA command when opening out of an HTML page? Perhaps another command would work better, or another way to open this doc from an HTML page? I would prefer not hard coding the location in the macro since the folder location of the Word doc and Access db may be anything. Thanks!

mdmackillop
04-01-2007, 03:18 PM
Hi Nymnyi,
Welcome to VBAX.
Don't really know anything about HTML coding but you could look at using the Shell command or the code posted here (http://www.vbaexpress.com/forum/showthread.php?t=9753&highlight=autorun)