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

    How to open doc in Explorer and start a macro (Office XP Word 2000 SP-2)

    I have been searching for a way to start a macro in my template when I open a document in Wind Explorer. So far I haven found any event that can trigger my macro in Word.
    Can anyone give me some info such that I can find a solution.

    I also have tried to change a setting in the registry,
    HKEY_LOCAL_MACHINE/SOFTWARE/Classes/Word.Document.8 from value "9" to value hexa "a", which opens the file itself rather than a "Document in Microsoft Internet Explorer".

    Part of the story can be found on: Post: 281140: (in the Word board)
    http://www.wopr.com/cgi-bin/w3t/showflat.p...sb=5&o=0&fpart=

    Anyone having a clue?

    Regards
    Bjorn

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to open doc in Explorer and start a macro (Office XP Word 2000 SP-

    Hi Bjorn:
    I'm not sure if this is what you mean but you can create a shortcut to open a doc & run a macro.
    The following Word startup (command-line) switches are listed in Word Help.
    <table border=1><td align=center valign=top>command</td><td align=center valign=top>function</td><td valign=top>/a</td><td valign=top>Starts Word; prevents add-ins and global templates (including Normal.dot) from being loaded automatically. The /a switch also locks the setting files; i.e., setting files cannot be read or modified if you use this switch.</td><td valign=top>/lAddinpath</td><td valign=top>Starts Word and then loads a specific Word add-in.</td><td valign=top>/m</td><td valign=top>Starts a new instance of Word without running any AutoExec macros.</td><td valign=top>/mMacroName</td><td valign=top>Starts Word and then runs a specific macro. The /m switch also prevents Word from running any AutoExec macros.</td><td valign=top>/n</td><td valign=top>Starts a new instance of Word with no document open. Documents opened in each instance of Word will not appear as choices in the Window menu of other instances.</td><td valign=top>/tTemplateName</td><td valign=top>Starts Word with a new document based on a template other than the Normal template. Note there's no space between switch & templatename.</td><td valign=top>/w</td><td valign=top>Starts a new instance of Word with a blank document. Documents opened in each instance of Word will not appear as choices in the Window menu of the other instances.</td><td valign=top>(no switch)</td><td valign=top>A new Word window is opened with a blank document using the existing instance of the Word application.</td></table>
    The following Word startup (command-line) switches are not listed in Word Help.
    <table border=1><td align=center valign=top>command</td><td align=center valign=top>function</td><td valign=top>/c</td><td valign=top>Starts a new instance of Word and then invokes NetMeeting.</td><td valign=top>/q</td><td valign=top>Starts Word without displaying the Word splash screen. This switch is only available in Word 2000 Service Release 1 (SR-1).</td><td valign=top>/r</td><td valign=top>Starts Word in the background, makes changes in the Windows registry, and then quits. This switch forces a re-register of Word in the Windows registry.</td><td valign=top>/u</td><td valign=top>Has no effect and does not start Word.</td><td valign=top>/x</td><td valign=top>Starts a new instance of Word from the operating shell (for example, to print in Word). This instance of Word responds to only one DDE request and ignores all other DDE requests and multi-instances. If starting a new instance of Word within the operating environment (for example, within Windows), it is recommended that you use the /w switch, which starts a fully functioning instance.</td><td valign=top>(any other switch)</td><td valign=top>Starts a new instance of Word. For example, if you start Word with just the / and no switch, or with any unlisted switch combination, Word doesn't understand what you want and just starts a new instance of Word with a new blank document.</td></table>
    Hope this helps,

  3. #3
    New Lounger
    Join Date
    Sep 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to open doc in Explorer and start a macro (Office XP Word 2000 SP-

    If Windows Explorer, then any Document_New macros should run when doubleclicked.
    If Internet Explorer, then read method below:

    To execute a .dot file from the browser so that document_new macros run and a .doc version of the template is opened, you need to use a workaround otherwise the .dot file is opened.

    Workaround is:
    1. Create a shortcut to the .dot file in the same folder on the web server.
    2. Create a hyperlink on the access page that references the shortcut eg. filename.dot.lnk. The .lnk is the file extension to the shortcut. Note that there is no need to ensure the .lnk is in the shortcut name. The shortcut name and the filename should be exact.
    3. Users may be prompted with a security warning because the file being opened can run code (assuming you have document-new macros). Just click Run from Current Location, and voila a .doc version of the .dot template is generated.

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

    Re: How to open doc in Explorer and start a macro (Office XP Word 2000 SP-

    Thanks to both of you.

    I have probably not explained myself good enough.
    What I need to do is to open a file (filename.doc) with a browser and get the Document_Open macro to start when opening it. This seems impossible to me, but ....
    The filename.doc have been created from a Word Template (template.dot) and placed in a SharePoint Folder. When opening the filename.doc a Document_Open macro should start (it collects the version number of the document from SharePoint).
    I have tried one of the switched but it did not work.


    Regarding Starting a template
    For starting a template (PowerPoint in this case) from a browser I have used the following link to a Shortcut which is made from the template. The template is located on my C: drive:

    http://S-OSL-23-0012/4telStd/Documents/Sho...te_2003.pot.lnk

    The Shortcut target is looking like this: "C:Program FilesOfficeTemplatesWordWorkgroup-templates1_EDB_Telesciences_Presentation_template_ 2003.pot" /n

    This starts a new PowerPoint presentation from a PP template as indicated by the extension (pot).

    Thanks
    Bj

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to open doc in Explorer and start a macro (Office XP Word 2000 SP-

    To have the document open in a browser window, you need to check the option "Browse in same window". I don't have WinXP, but in Win98, it's under Start/Settings/Folder options/File Types/Scroll for Microsoft Word Document/click edit & check the box.See attachment. However, I think you'll still have trouble running the macro. There have been posts on this before, but I can't search. I think Jefferson posted a solution (or decided that it couldn't be done).
    Attached Images Attached Images

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Long Beach, California, USA
    Posts
    1,912
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to open doc in Explorer and start a macro (Office XP Word 2000 SP-

    Sorry, is this an IE issue or a Word issue? I am not sure of the role IE is playing in this problem. Could you specify how IE is involved?

  7. #7
    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: How to open doc in Explorer and start a macro (Office XP Word 2000 SP-

    Attention everyone, Bjorn is using Sharepoint Team Server to host Word documents that are accessed through a browser. When Word is launched from a link in a browser, it typically fails to run AutoOpen and Document_Open macros. Hope this saves you from reading 5 other message threads and highlights where the problem is.

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

    Re: How to open doc in Explorer and start a macro (Office XP Word 2000 SP-

    Thanks for the good information.

    It looks as this problem, which I asked for in the Word group, isn't possible to get any answer to. I have tried several places and thought may be someone on Internet Explorer could give me some hints about where/what to look for.

    The problem is Microsoft's, it is a bad functionality between SharePoint Portal Server and Word (Office XP documents). The case is may be such that no one knows both applications in order to be able to understand it (???) May be I am wrong. I have to look other places.

    Microsoft's solution to this issue is shown on the link below, but the solution they recommend does not work for us.

    It is announced and explained here: http://support.microsoft.com/default.aspx?...kb;en-us;328969

    Any way

    Thanks for good help!!

    Bj

Posting Permissions

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