Page 1 of 3 123 LastLast
Results 1 to 15 of 35
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Open documents and start macros in doc. (IE 6.0.2600.000)

    Problem:

    1:
    Opening an Office (Word) document with a http-link results in opening the file as a temp file. I want to open the file such that it is editable. How to set IE/Registry to do this?

    2:
    Opening an Office (Word) document with a http-link that contains a macro that shall start when the document is opened, does not work. How to set IE/Registry to do this?

    3:
    Starting a Word template(.dot file) with a http-link does not work. Only the .dot file is opened. How to set IE/Registry to handle .dot files as Word does it?


    (We are using Microsoft Office 2000, Word 2000 and SharePoint Portal Server for archiving and controlling documents and this system is based on http - links.)

    Would verry much appreciate solutions to my problems.

    Thanks!

    Regards
    Bj

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    Renton, Washington, USA
    Posts
    12,560
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Are these Word files on a in house server or out on the internet?
    Also do you in fact have write access to these servers?

    Now running HP Pavilion a6528p, with Win7 64 Bit OS.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Some of these symptoms can be caused by the document opening in IE with a Word toolbar rather than in the Word application. I believe this is controlled by the Browse in same window setting that you can find in the File Types dialog. (Many past illustrations here in the Lounge.)

    With respect to the templates, you can use VBScript to Shell the template into a new document. I have posted the code here before for both Word and Excel.

  4. #4
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Thanks!

    Status when opening with a http address:
    In the Application title bar at the top of the window it is written: Document in Microsoft Internet Explorer - Microsoft Word. (The document is a temp file!)
    My standard Word toolbars are vissible.
    If I display the toolbar called Web, it is empty. (testing by inserting the field code FileName gives the same file name as at the top)

    If I use SaveAs, the document will be saved at the selected folder but the "Document in Microsoft Internet Explorer - Microsoft Word" is still in the window and the new one is diappeared.

    The setting in WinExplorer: Tools/Folder Options ... "Brows in same" window is not marked

    **************************************
    Is this any solution?:
    If I set the registry key: HKEY_LOCAL_MACHINE/SOFTWARE/Classes/Word.Document.8/BrowserFlags to a Value: a (10), the document will open in Word in read only mode and will be editable when Read Only is removed.

    The same setting is effective for PowerPoint documents as well, then in another key which is: HKEY_LOCAL_MACHINE/SOFTWARE/Classes/PowerPoint.Show.8/BrowserFlags Value: a (10)

    BUT! Using this setting in the registry the document opens OK, but a code inserted in the "Private Sub Document_Open()" procedure, which shall start when the document opens in order to retrieve a version number from SharePoint, does not start.

    Are there other settings in the registry that controls this behaviour?
    There may also be a setting for how the browser treats a document containing macros or documents that are based on a template (.dot file) located in the Workgroup-templates catalog, located another place.

    Using Microsoft TecNet and other help, are very difficult use in order to find explanations and solutions to these things.

    **********************************************'

    Regarding VBScript to Shell the template. This I would appreciate very much to get hold of. It may solve all these problems. I shall search for it, but if you could give me a word(s) for which to search for it would be most helpfull.

    Thanks a lot!

    Regards
    Bj

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    If Browse in Same Window is unchecked, I don't know why it is browsing in the same window! But IE behaves in mysterious ways sometimes.

    Regarding BrowserFlags, this might have been discussed before. I haven't researched them recently.

    One of the posts regarding VBScript/template options is <!post=Post #130411,130411>Post #130411<!/post>. It's not on the IE board; sorry if you've been scouring this one.

  6. #6
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Hi,

    Thanks!

    The document opens in Word (sorry if I have explained myself wrong). But the procedure "Private Sub Document_Open()" located in the module "ThisDocument", does not start when the document is opened from IE or with a http address. It starts if I opens the document using Windows Explorer.

    Regards
    Bj

  7. #7
    New Lounger
    Join Date
    Oct 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    I am having the same problem. We have a number of Word and Excel documents we would like to make available on our intranet. Everything work fine unless the document contains VBA. The VBA runs if I open the document through explorer. It also runs if I use Netscape (which is not our default browser). Any other suggestions?

  8. #8
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Thanks,
    though it is not a pleasure that you have the same problem.

    Microsoft has come with a SharePointPortal Server (SPPS) which "takes caere of" documents: control them with version numbers etc.. Also Microsoft supply VBA, for us to make documents based on e.g. Word templates. SharePoint functions like IE; the documents are stored on an URL address (http) and then the AutoOpen or DocumentOpen macro starts when opening a document from SPPS.

    I have asked other places but in vain. Hopefully someobe can give an explanation why the macro will not start. Security reason has been mensioned, but I have tried to set security to Low in Word without any changes.

    I'm waiting for a miracle?

    Bj

  9. #9
    New Lounger
    Join Date
    Oct 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    OK. I did find something that works. If you create a shortcut to your word document and place the shortcut in the directory with the document, then change the link to point to the shortcut (.lnk) rather than the document itself, it works. I had to rename the shortcut after I created it or clicking the link just resulted in trying to open the shortcut itself rather than opening the document. But after renaming the shortcut and creating the link, it worked! However in my case, this required that the users be able to log into the server where the documents reside rather than just have access to the intranet (controlled by border manager). Hope this helps you more than it helped me!

  10. #10
    New Lounger
    Join Date
    Dec 2002
    Location
    London, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    We have had a similar problem with making documents available over the intranet and getting startup code to run. In the end we created some JavaScript to explicitly open Word (using ActiveX), open the document and then run the startup macro on the document before making the application (and the document) available to the users

    Very convoluted but it works.

    The other solution may be to write a COM add-in to Word. I believe this then works every time - even through IE

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Would you be interested in posting a sample of that code for future reference? I'm attaching a ZIP file with a demo of the original problem and the other two work-arounds.
    Attached Files Attached Files

  12. #12
    New Lounger
    Join Date
    Dec 2002
    Location
    London, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Sure - the javascript is as follows:

    function loadDocument(documentName)
    {
    objWord = new ActiveXObject( "Word.Application" );
    objWord.Documents.Open(documentName);
    objWord.Run("macroname");
    objWord.visible = true;
    objWord.Activate();
    }

  13. #13
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Thanks! I've always used VBScript for this sort of thing and didn't know how to create the object in JavaScript. (The equivalence with VBScript's CreateObject is illustrated here as well. Easy to find once you know what you're looking for. <img src=/S/wink.gif border=0 alt=wink width=15 height=15> )

  14. #14
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Hi there - I know this thread is a bit old now, but I am very interested in being able to use the javascript you posted to open Word documents and have their document_open (or document_new in templates) subs run, but I know very little about Javascript.

    Could you possibly let me know how to use the code you posted within an html page, please?

    I would be most grateful.
    Beryl M


  15. #15
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Open documents and start macros in doc. (IE 6.0.2600.000)

    Beryl

    Try the code that Jefferson posted (as an attachment) using VBScript. He has attached a sample html page with a word doc and instructions.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Page 1 of 3 123 LastLast

Posting Permissions

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