Results 1 to 11 of 11
  1. #1
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Hyperlink opens form to .dot (Word 97)

    I seem to hit brick walls at every step of my project!!

    I have set Hyperlinks in my document to open a form that is a Word Template. The trouble is that I dont want the users to open the actual template as a .dot file - I want them to be opened as .doc files.

    Any ideas?

    Kerry

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink opens form to .dot (Word 97)

    Edited - Note edit in code (added backslash) shown in <font color=red>red</font color=red>

    I'm not sure exactly what you're wanting to do here, Kerry. But I'm guessing that you want the user to be able to click some text that says something like "Click here to create a new XYZ document". If this is the case, you're wanting to run a macro, rather than open an existing file. The macro code would look something like this:

    Sub NewXYZDoc()

    Documents.Add Template:= _
    "C:WINDOWSApplication DataMicrosoftTemplatesXYZ.dot", _
    NewTemplate:=False, DocumentType:=0

    End Sub

    I'm not sure how to make this more "general", so that the correct template path would be found on the user's machine. Another guess (should work) is to replace the path above with
    Options.DefaultFilePath(wdUserTemplatesPath), so you'd use something like:

    Dim XYZRef
    XYZRef = Options.DefaultFilePath(wdUserTemplatesPath) & "<font color=red></font color=red>XYZ.dot"
    Documents.Add Template:= _
    XYZRef, NewTemplate:=False, DocumentType:=0

    And I'm not sure if you can run a macro from a hyperlink. But you certainly can from a MACROBUTTON field, like the one I included in the DocVarDemo1.dot example I posted (but the user will need to double-click this kind of link).

    Brickwalls are what it's all about <img src=/S/grin.gif border=0 alt=grin width=15 height=15>. Enjoy <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>.

    Alan

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

    Re: Hyperlink opens form to .dot (Word 97)

    This question gets asked pretty often so if you have a search in this forum you should find some useful information.

    This should get you started - Post 292412
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Re: Hyperlink opens form to .dot (Word 97)

    Andrew you have hit the nail on the head in understanding my problem and your solution would be great except for one major issue.

    These templates are part of a complete electronic manual. I have 9 Chapters in separate files all of which have their own table of contents. The forms are referred to in hyperlinks throughout the chapters. Due to the limitations of our departmental network, the complete bundle will be placed on 10 different snap servers. Hence the lack of "relativity" poses a major problem.

    <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15> I live in hope!!

    Kerry

  5. #5
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Re: Hyperlink opens form to .dot (Word 97)

    Alan you need a medal - you are so patient with me.

    Andrew has understood my problem - but as you will see by my response to him, I still have problems. Also the files are not placed in the user templates location. They are in a folder called Forms as part of the compilation that makes up my project. Which will then be placed on 10 different servers.

    Kerry

    Kerry

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink opens form to .dot (Word 97)

    In that case, assuming your "Forms" folder is a child folder of the folder containing the document with the link, then

    XYZRef = ActiveDocument.Path & Application.PathSeparator & _
    "Forms" & Application.PathSeparator & "XYZ.dot"

    should work in the code I gave. If it's some other folder structure, things might get stickier.

    Alan

  7. #7
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Re: Hyperlink opens form to .dot (Word 97)

    I foound this code in Jefferson's post <post#=130411>post 130411</post#>. The code at the bottom of the post ALMOST works.

    I dont know where I should add it in a form?

    Also it crashes on Word 97 but clunks through on Word 2002.

    I think with some work, we might be able to get it working. Well - maybe - I live in hope!
    Attached Files Attached Files

  8. #8
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink opens form to .dot (Word 97)

    Maybe Jefferson could best answer that. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> Another post (the attachment) that may be of significance is <post#=261488>post 261488</post#> (where are you Macropod?) Again, I haven't looked at the details though.

    Alan

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

    Re: Hyperlink opens form to .dot (Word 97)

    With Jefferson's VBA code you don't load it in your form. It should go in another module. You might already have an AutoNew macro sitting in there which calls the user form you have been playing with. This might cause some problems as I don't know whether the AutoNew macro will run before or after the AutoOpen macro and this will take some nutting out for you.

    I would expect the AutoOpen macro to run when the template is OPENED and then when the new document is created, both macros will run (but in which order).
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  10. #10
    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: Hyperlink opens form to .dot (Word 97)

    No wonder my ears were burning. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    If you place the AutoOpen macro in a code module in the template you are linking to, it should activate when the user clicks the link and opens the template.

    In the future, to edit that template, hold the shift key when opening it to temporarily deactivate the AutoOpen macro.

  11. #11
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Re: Hyperlink opens form to .dot (Word 97)

    Ahh - its esp!

    Thanks Jefferson.

    I have so many issues happening at the moment - I am in a spin. The help from this forum is so great, I am like a kid in a lolly shop! I will have to slow down and work through one at a time.

    Bye for now
    Kerry

Posting Permissions

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