Consulting

Results 1 to 2 of 2

Thread: Retaining doc path when opening in HTML

  1. #1

    Retaining doc path when opening in HTML

    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!

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    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
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •