Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Broken Excel hyperlink to Word Template | Excel Discussion (Misc queries) | |||
List - Hyperlink - Template - Email | Excel Discussion (Misc queries) | |||
How can I link between a Word template and an Excel template | Excel Discussion (Misc queries) | |||
Excel Hyperlink doesn't open Word doc the same way as Word does | Excel Discussion (Misc queries) | |||
Hyperlink to a template | Excel Discussion (Misc queries) |