Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Access to Start Other Office Apps

Status
Not open for further replies.

cc5305

MIS
Oct 4, 2000
70
US
Hi, I would like to have my Access database to be able to start a new Word document base on a Word Template. I would like to find out if it is possible for me to do that. Thanks.
 
I probably sound pretty stupid, but what is a .cmd file and how do I create it?
 
This code will open Word from Access97. I have got to go home now, and can't remember the method of creating a new document. If no one else has come up with a solution by tomorrow I'll do some research and post more code.


Function StartWord()
Dim WDApp As Object
On Error Resume Next 'ignore error if Wordnot running
Set WDApp = GetObject("word.Application") 'Check for Word
If Err <> 0 Then
Set WDApp = CreateObject(&quot;Word.Application&quot;) 'Open Word
End If
On Error GoTo 0 'reset error handling
WDApp.Visible = True 'Make Word Visible
End Function
 
Well, I had the same problem. I wanted to open a specific .ktc file. A ktc file is a file within the application keaterm. It is possible to start Keaterm but not the specific ktc file.
So to put it in your case.
you create a command file. A command file is a sequence of dos commands you run, as you were typing them.

I am at my home PC, so I can't provide you an example.

You can also check this link:
There you find an introduction to creating these kind of files.

Good luck !

I activated the email notification, so don't hesitate to reply. I am cooking for the moment. I will check my mail :)
 
It's just come to me, sorry about the double posting, to create a new document from a template your code should have the following line:

WDApp.Documents.Add Template:= _
&quot;C:\Program Files\Microsoft Office\Templates\Siemens\Car Hire Form.dot&quot;, _
NewTemplate:=False


You'll have to put in the appropriate path for your particular template(s)
 
this opens the word application, but not the template he desired....
 
cc5305 , I stop checking my mail :)
I think you have all the possible solutions here.

If you have the time, check out my thread. (shift key and domain recognition)
 
The underscore in my previous posting is important as it acts as a continuation for the line of code. If you use a single line then this should work

WDApp.Documents.Add Template:= &quot;C:\Program Files\Microsoft Office\Templates\Siemens\CarHireForm.dot&quot;, NewTemplate:=False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top