Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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" 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Broken Excel hyperlink to Word Template FC Excel Discussion (Misc queries) 0 May 20th 10 07:19 PM
List - Hyperlink - Template - Email SteveT Excel Discussion (Misc queries) 2 June 17th 08 05:52 PM
How can I link between a Word template and an Excel template Josh Excel Discussion (Misc queries) 0 April 1st 08 12:36 AM
Excel Hyperlink doesn't open Word doc the same way as Word does duugg Excel Discussion (Misc queries) 2 October 12th 06 03:14 PM
Hyperlink to a template Murray Excel Discussion (Misc queries) 1 June 10th 05 01:29 PM


All times are GMT +1. The time now is 03:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"