+ Reply to Thread
Results 1 to 5 of 5

Hyperlink to Word Template

  1. #1
    Steve C
    Guest

    Hyperlink to Word Template

    In Excel, I want to create a link to a Word template. However, I want Word
    to open in a new document and not open the template itself. Do I need
    programming to do this (and assign it to a command button instead)? Thanks!
    --
    Steve C

  2. #2
    Heather Heritage
    Guest

    Re: Hyperlink to Word Template

    A hyperlink will open a the link - so yes, if you want to do FILE NEW (i.e a
    new document based on the template) then you will need a macro - so a button
    would be the obvious way forward!
    "Steve C" <[email protected]> wrote in message
    news:[email protected]...
    > In Excel, I want to create a link to a Word template. However, I want

    Word
    > to open in a new document and not open the template itself. Do I need
    > programming to do this (and assign it to a command button instead)?

    Thanks!
    > --
    > Steve C




  3. #3
    Steve C
    Guest

    RE: Hyperlink to Word Template

    What is the programming code I would need to make it open as a new document
    instead of a template? Thanks!
    --
    Steve C


    "Steve C" wrote:

    > In Excel, I want to create a link to a Word template. However, I want Word
    > to open in a new document and not open the template itself. Do I need
    > programming to do this (and assign it to a command button instead)? Thanks!
    > --
    > Steve C


  4. #4
    Dave Peterson
    Guest

    Re: Hyperlink to Word Template

    Can you add a shape/button and assign a macro to that shape?

    Option Explicit
    Sub testme01()

    Dim oWord As Object
    Dim myWordTemplate As String
    Dim testStr As String

    myWordTemplate = "c:\msoffice\templates\1033\Elegant Fax.dot"

    testStr = ""
    On Error Resume Next
    testStr = Dir(myWordTemplate)
    On Error GoTo 0
    If testStr = "" Then
    MsgBox myWordTemplate & " doesn't exist"
    Exit Sub
    End If

    On Error Resume Next
    Set oWord = GetObject(, "Word.Application")
    If Err Then
    Set oWord = CreateObject("Word.Application")
    End If

    oWord.Visible = True
    oWord.Documents.Add Template:=myWordTemplate

    End Sub

    Steve C wrote:
    >
    > In Excel, I want to create a link to a Word template. However, I want Word
    > to open in a new document and not open the template itself. Do I need
    > programming to do this (and assign it to a command button instead)? Thanks!
    > --
    > Steve C


    --

    Dave Peterson

  5. #5
    Steve C
    Guest

    Re: Hyperlink to Word Template

    I created a command button and assigned your code to it. Works perfectly.
    Thanks, Dave!
    --
    Steve C


    "Dave Peterson" wrote:

    > Can you add a shape/button and assign a macro to that shape?
    >
    > Option Explicit
    > Sub testme01()
    >
    > Dim oWord As Object
    > Dim myWordTemplate As String
    > Dim testStr As String
    >
    > myWordTemplate = "c:\msoffice\templates\1033\Elegant Fax.dot"
    >
    > testStr = ""
    > On Error Resume Next
    > testStr = Dir(myWordTemplate)
    > On Error GoTo 0
    > If testStr = "" Then
    > MsgBox myWordTemplate & " doesn't exist"
    > Exit Sub
    > End If
    >
    > On Error Resume Next
    > Set oWord = GetObject(, "Word.Application")
    > If Err Then
    > Set oWord = CreateObject("Word.Application")
    > End If
    >
    > oWord.Visible = True
    > oWord.Documents.Add Template:=myWordTemplate
    >
    > End Sub
    >
    > Steve C wrote:
    > >
    > > In Excel, I want to create a link to a Word template. However, I want Word
    > > to open in a new document and not open the template itself. Do I need
    > > programming to do this (and assign it to a command button instead)? Thanks!
    > > --
    > > Steve C

    >
    > --
    >
    > Dave Peterson
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1