|
 |
access thread: Run-time error '5137': This document template does not exist
Message #1 by "Tammy Tappan" <GRTappan@e...> on Mon, 26 Nov 2001 18:42:13
|
|
The code is:
Private Const m_strDIR As String = " K:\DATA\PRIVATE\Iscs\Templates\"
Private Const m_strTEMPLATE As String
= "ServiceCenterUserIDRequestForm.dot"
Private m_objWord As Word.Application
Private m_objDoc As Word.Document
Public Sub CreateSCIDRequestDoc()
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
m_objWord.PrintOut Background:=False
m_objDoc.SaveAs FileName:=m_strDIR & "User ID Request for" & ".doc"
m_objDoc.Close
m_objWord.Quit
Set m_objDoc = Nothing
Set m_objWord = Nothing
End Sub
(I took it basically from page 540/541 of Beginning Access 2000 VBA by
Robert Smith & David Sussman)
When I try to run the code from the Immediate window, I get the Run-time
error that the template doesn't exist; when I click on Debug - it
highlights the line of code:
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
Any clues? (The template document does exist as a .dot exactly where the
general declarations says it does.)
+Tammy
Message #2 by "Tammy Tappan" <GRTappan@e...> on Mon, 26 Nov 2001 18:48:40
|
|
Sorry! I forgot to mention the object of this code! I want to open a .dot
as "Document 1" - essentially, to get it to work like a normal template
opened in Word by choosing File>New, & selecting the template.
The "SaveAs" part will need to be modified based on the user for whom the
ID is being requested, but that's a step down the road!
+Tammy
> The code is:
>
> Private Const m_strDIR As String = " K:\DATA\PRIVATE\Iscs\Templates\"
> Private Const m_strTEMPLATE As String
> = "ServiceCenterUserIDRequestForm.dot"
>
> Private m_objWord As Word.Application
> Private m_objDoc As Word.Document
> Public Sub CreateSCIDRequestDoc()
>
> Set m_objWord = New Word.Application
> Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
>
> m_objWord.PrintOut Background:=False
>
> m_objDoc.SaveAs FileName:=m_strDIR & "User ID Request for" & ".doc"
> m_objDoc.Close
> m_objWord.Quit
>
> Set m_objDoc = Nothing
> Set m_objWord = Nothing
>
>
> End Sub
>
> (I took it basically from page 540/541 of Beginning Access 2000 VBA by
> Robert Smith & David Sussman)
>
> When I try to run the code from the Immediate window, I get the Run-time
> error that the template doesn't exist; when I click on Debug - it
> highlights the line of code:
> Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
>
> Any clues? (The template document does exist as a .dot exactly where the
> general declarations says it does.)
>
> +Tammy
Message #3 by "John Ruff" <papparuff@c...> on Mon, 26 Nov 2001 10:57:58 -0800
|
|
Tammy,
Change your set command to:
Set m_objDoc = m_objWord.Documents.Add Template:=m_strDIR &
m_strTEMPLATE, NewTemplate:= False
John Ruff - The Eternal Optimist :-)
-----Original Message-----
From: Tammy Tappan [mailto:GRTappan@e...]
Sent: Monday, November 26, 2001 6:42 PM
To: Access
Subject: [access] Run-time error '5137': This document template does not
exist
The code is:
Private Const m_strDIR As String = " K:\DATA\PRIVATE\Iscs\Templates\"
Private Const m_strTEMPLATE As String
= "ServiceCenterUserIDRequestForm.dot"
Private m_objWord As Word.Application
Private m_objDoc As Word.Document
Public Sub CreateSCIDRequestDoc()
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
m_objWord.PrintOut Background:=False
m_objDoc.SaveAs FileName:=m_strDIR & "User ID Request for" & ".doc"
m_objDoc.Close
m_objWord.Quit
Set m_objDoc = Nothing
Set m_objWord = Nothing
End Sub
(I took it basically from page 540/541 of Beginning Access 2000 VBA by
Robert Smith & David Sussman)
When I try to run the code from the Immediate window, I get the Run-time
error that the template doesn't exist; when I click on Debug - it
highlights the line of code:
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
Any clues? (The template document does exist as a .dot exactly where the
general declarations says it does.)
+Tammy
---
You are currently subscribed to access as: papparuff@c... To
unsubscribe send a blank email to $subst('Email.Unsub')
Message #4 by Walt Morgan <wmorgan@s...> on Mon, 26 Nov 2001 12:53:16 -0600
|
|
Tammy,
You may wish to fully qualify as to drive & path your m_strTEMPLATE value.
For example:
"K:\DATA\PRIVATE\Iscs\Templates\ServiceCenterUserIDRequestForm.dot"
I believe it is looking for the file in the current directory, whatever it
happens to be.
Walt
Message #5 by "Tammy Tappan" <GRTappan@e...> on Mon, 26 Nov 2001 20:37:34
|
|
Tried that & the suggestion above (all possible combinations thereof!),
but I still get the error.
Am I doing this the hard way? Is there an easier way to create a hyperlink
to the .dot, but have it open as a .doc (work like a template should)?
+Tammy
> Tammy,
>
> You may wish to fully qualify as to drive & path your m_strTEMPLATE
value.
>
> For example:
> "K:\DATA\PRIVATE\Iscs\Templates\ServiceCenterUserIDRequestForm.dot"
>
> I believe it is looking for the file in the current directory, whatever
it
> happens to be.
>
> Walt
>
>
>
>
Message #6 by "John Ruff" <papparuff@c...> on Mon, 26 Nov 2001 13:23:48 -0800
|
|
Gee Tammy,
I just noticed something. Did you cut and paste your code from your
procedure to your email? Here is what it looks like to us.
Private Const m_strDIR As String = " K:\DATA\PRIVATE\Iscs\Templates\"
Private Const m_strTEMPLATE As String
= "ServiceCenterUserIDRequestForm.dot"
I notice that Private Const m_strDIR As String = "
K:\DATA\PRIVATE\Iscs\Templates\" has a space after the first " and
before K:\. Remove the space, change it to Private Const m_strDIR As
String = "K:\DATA\PRIVATE\Iscs\Templates\"
Make sure Private Const m_strTEMPLATE As String
"ServiceCenterUserIDRequestForm.dot" is on it's own line. Your code
should look like this;
Private Const m_strDIR As String = "K:\DATA\PRIVATE\Iscs\Templates\"
Private Const m_strTEMPLATE As String
"ServiceCenterUserIDRequestForm.dot"
Otherwise, I can only think that maybe the template name is misspelled
in your procedure. Try this; go to the directory where the template is
located, right-click on the template, select rename, then press CTRL+c
to copy the name of the template to the clipboard. Now paste the name of
the template to m_strTEMPLATE As String = "Past here"
You might even want to cut and past the directory to
Private Const m_strDIR As String = "Paste directory here"
I hope this solves the issue.
John Ruff - The Eternal Optimist :-)
-----Original Message-----
From: Tammy Tappan [mailto:GRTappan@e...]
Sent: Monday, November 26, 2001 8:38 PM
To: Access
Subject: [access] Re: Run-time error '5137': This document template does
not- exist
Message #7 by "Tammy Tappan" <GRTappan@e...> on Mon, 26 Nov 2001 22:11:26
|
|
Well, I removed the space (oops!), & as for the file paths & names - I had
done the copy/paste already. The code was all on one line; I think the
settings for this posting system broke it up.
Try again? ;)
+Tammy
> Gee Tammy,
>
> I just noticed something. Did you cut and paste your code from your
> procedure to your email? Here is what it looks like to us.
>
> Private Const m_strDIR As String = " K:\DATA\PRIVATE\Iscs\Templates\"
> Private Const m_strTEMPLATE As String
> = "ServiceCenterUserIDRequestForm.dot"
>
> I notice that Private Const m_strDIR As String = "
> K:\DATA\PRIVATE\Iscs\Templates\" has a space after the first " and
> before K:\. Remove the space, change it to Private Const m_strDIR As
> String = "K:\DATA\PRIVATE\Iscs\Templates\"
>
> Make sure Private Const m_strTEMPLATE As String
> "ServiceCenterUserIDRequestForm.dot" is on it's own line. Your code
> should look like this;
>
> Private Const m_strDIR As String = "K:\DATA\PRIVATE\Iscs\Templates\"
> Private Const m_strTEMPLATE As String
> "ServiceCenterUserIDRequestForm.dot"
>
> Otherwise, I can only think that maybe the template name is misspelled
> in your procedure. Try this; go to the directory where the template is
> located, right-click on the template, select rename, then press CTRL+c
> to copy the name of the template to the clipboard. Now paste the name of
> the template to m_strTEMPLATE As String = "Past here"
>
> You might even want to cut and past the directory to
> Private Const m_strDIR As String = "Paste directory here"
>
> I hope this solves the issue.
>
> John Ruff - The Eternal Optimist :-)
>
>
>
> -----Original Message-----
> From: Tammy Tappan [mailto:GRTappan@e...]
> Sent: Monday, November 26, 2001 8:38 PM
> To: Access
> Subject: [access] Re: Run-time error '5137': This document template does
> not- exist
>
>
Message #8 by "John Ruff" <papparuff@c...> on Mon, 26 Nov 2001 14:11:58 -0800
|
|
Tammy,
Was the space in Private Const m_strDIR As String = "
K:\DATA\PRIVATE\Iscs\Templates\" in your procedure? If it was, I know
you removed it. After removing the space, did you try to run the
program again?
John V. Ruff - The Eternal Optimist :-)
(Trying anything and everything(
-----Original Message-----
From: Tammy Tappan [mailto:GRTappan@e...]
Sent: Monday, November 26, 2001 10:11 PM
To: Access
Subject: [access] Re: Run-time error '5137': This document template does
not- exist
Well, I removed the space (oops!), & as for the file paths & names - I
had
done the copy/paste already. The code was all on one line; I think the
settings for this posting system broke it up.
Try again? ;)
+Tammy
> Gee Tammy,
>
> I just noticed something. Did you cut and paste your code from your
> procedure to your email? Here is what it looks like to us.
>
> Private Const m_strDIR As String = " K:\DATA\PRIVATE\Iscs\Templates\"
> Private Const m_strTEMPLATE As String =
> "ServiceCenterUserIDRequestForm.dot"
>
> I notice that Private Const m_strDIR As String = "
> K:\DATA\PRIVATE\Iscs\Templates\" has a space after the first " and
> before K:\. Remove the space, change it to Private Const m_strDIR As
> String = "K:\DATA\PRIVATE\Iscs\Templates\"
>
> Make sure Private Const m_strTEMPLATE As String =
> "ServiceCenterUserIDRequestForm.dot" is on it's own line. Your code
> should look like this;
>
> Private Const m_strDIR As String = "K:\DATA\PRIVATE\Iscs\Templates\"
> Private Const m_strTEMPLATE As String
> "ServiceCenterUserIDRequestForm.dot"
>
> Otherwise, I can only think that maybe the template name is misspelled
> in your procedure. Try this; go to the directory where the template
> is located, right-click on the template, select rename, then press
> CTRL+c to copy the name of the template to the clipboard. Now paste
> the name of the template to m_strTEMPLATE As String = "Past here"
>
> You might even want to cut and past the directory to
> Private Const m_strDIR As String = "Paste directory here"
>
> I hope this solves the issue.
>
> John Ruff - The Eternal Optimist :-)
>
>
>
> -----Original Message-----
> From: Tammy Tappan [mailto:GRTappan@e...]
> Sent: Monday, November 26, 2001 8:38 PM
> To: Access
> Subject: [access] Re: Run-time error '5137': This document template
does
> not- exist
>
>
---
You are currently subscribed to access as: papparuff@c... To
unsubscribe send a blank email to $subst('Email.Unsub')
Message #9 by "Tammy Tappan" <GRTappan@e...> on Mon, 26 Nov 2001 22:48:50
|
|
Well, duh! It wasn't just the space; one of the previous posts said I
should try putting the whole path on the TEMPLATE string line; I just
removed it - & it worked!
Okay - new problem! When I ran the code, it printed the blank form (I
didn't pass any info), & then closed Word. What I really need it to do is
open the document & stop - let the user fill it out & save the document.
So, I removed most of the end of the code so it now looks like this:
Public Sub CreateSCIDRequestDoc()
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
m_objDoc.SaveAs FileName:=m_strDIRSAVE & "User ID Request for" & ".doc"
End Sub
So now, when I run it, I get a new Run-time error: 5272 - "Application-
defined or object-defined error".
+Tammy
> Tammy,
>
> Was the space in Private Const m_strDIR As String = "
> K:\DATA\PRIVATE\Iscs\Templates\" in your procedure? If it was, I know
> you removed it. After removing the space, did you try to run the
> program again?
>
> John V. Ruff - The Eternal Optimist :-)
> (Trying anything and everything(
>
Message #10 by "Tammy Tappan" <GRTappan@e...> on Mon, 26 Nov 2001 23:05:09
|
|
Oh yeah - the Debug points to:
m_objDoc.SaveAs FileName:=m_strDIRSAVE & "User ID Request for" & ".doc"
I'm trying to get it to automatically save the file with a certain name
(to be added later, when I get the form part done!)
+Tammy
> Well, duh! It wasn't just the space; one of the previous posts said I
> should try putting the whole path on the TEMPLATE string line; I just
> removed it - & it worked!
>
> Okay - new problem! When I ran the code, it printed the blank form (I
> didn't pass any info), & then closed Word. What I really need it to do
is open the document & stop - let the user fill it out & save the
document.
So, I removed most of the end of the code so it now looks like this:
Public Sub CreateSCIDRequestDoc()
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
m_objDoc.SaveAs FileName:=m_strDIRSAVE & "User ID Request for" & ".doc"
End Sub
> So now, when I run it, I get a new Run-time error: 5272 - "Application-
> defined or object-defined error".
>
>
> +Tammy
>
> > Tammy,
> >
> > Was the space in Private Const m_strDIR As String = "
> > K:\DATA\PRIVATE\Iscs\Templates\" in your procedure? If it was, I know
> > you removed it. After removing the space, did you try to run the
> > program again?
> >
> > John V. Ruff - The Eternal Optimist :-)
> > (Trying anything and everything(
> >
Message #11 by "John Ruff" <papparuff@c...> on Mon, 26 Nov 2001 15:08:22 -0800
|
|
Tammy,
Here is what the MS Automation 97 Help file says about keeping Word open
Opening a Microsoft Word Document
This example demonstrates how to use Automation to open Microsoft Word
and a document for viewing. Note the use of the Static keyword to
prevent the object variable from losing scope. Once the object variable
loses scope, the instance of Microsoft Word is destroyed.
Sub OpenWordDoc()
Static WordObj As Word.Application
Set WordObj = Nothing
Set WordObj = CreateObject("Word.Application")
WordObj.Documents.Open ("C:\My Documents\Test.doc")
'Enable viewing the Word session and its document
WordObj.Visible = True
End Sub
So, if you use Static, the word document will remain open for the user.
MS Automation 97 Help is an excellent program for Automation and most of
it also relates to Office2K and OfficeXP.
Go to http://search.support.microsoft.com/kb/c.asp?fr=0&SD=GN&LN=EN-US
In the Article ID Number enter Q167223 and download Auto97.exe and
install it.
If you want automation for Office2K or OfficeXP then it's Article ID
Number Q253338 and the file is OffAutmn.exe. Even though this program is
for Access97 also, I find Auto97.exe much more useful and easier to find
things.
John V. Ruff - The Eternal Optimist :-)
-----Original Message-----
From: Tammy Tappan [mailto:GRTappan@e...]
Sent: Monday, November 26, 2001 10:49 PM
To: Access
Subject: [access] Re: Run-time error '5137': This document template does
not- exist
Well, duh! It wasn't just the space; one of the previous posts said I
should try putting the whole path on the TEMPLATE string line; I just
removed it - & it worked!
Okay - new problem! When I ran the code, it printed the blank form (I
didn't pass any info), & then closed Word. What I really need it to do
is
open the document & stop - let the user fill it out & save the document.
So, I removed most of the end of the code so it now looks like this:
Public Sub CreateSCIDRequestDoc()
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
m_objDoc.SaveAs FileName:=m_strDIRSAVE & "User ID Request for" &
".doc"
End Sub
So now, when I run it, I get a new Run-time error: 5272 - "Application-
defined or object-defined error".
+Tammy
> Tammy,
>
> Was the space in Private Const m_strDIR As String = "
> K:\DATA\PRIVATE\Iscs\Templates\" in your procedure? If it was, I know
> you removed it. After removing the space, did you try to run the
> program again?
>
> John V. Ruff - The Eternal Optimist :-)
> (Trying anything and everything(
>
---
You are currently subscribed to access as: papparuff@c... To
unsubscribe send a blank email to $subst('Email.Unsub')
Message #12 by "Tammy Tappan" <GRTappan@e...> on Mon, 26 Nov 2001 23:18:09
|
|
Okay, you lost me! =) I'm REALLY new at VBA, so bear with me.
If I change all my code to what you have below, how does it open my
template as a document to be filled in & saved? Or, am I just supposed to
add some of that to my existing code?
+Tammy
(Always a Pollyanna, 'cuz I know we're gonna get this thing to work yet!)
> Tammy,
>
> Here is what the MS Automation 97 Help file says about keeping Word open
>
> Opening a Microsoft Word Document
>
> This example demonstrates how to use Automation to open Microsoft Word
> and a document for viewing. Note the use of the Static keyword to
> prevent the object variable from losing scope. Once the object variable
> loses scope, the instance of Microsoft Word is destroyed.
>
> Sub OpenWordDoc()
> Static WordObj As Word.Application
> Set WordObj = Nothing
> Set WordObj = CreateObject("Word.Application")
> WordObj.Documents.Open ("C:\My Documents\Test.doc")
>
> 'Enable viewing the Word session and its document
> WordObj.Visible = True
> End Sub
>
> So, if you use Static, the word document will remain open for the user.
>
> MS Automation 97 Help is an excellent program for Automation and most of
> it also relates to Office2K and OfficeXP.
> Go to http://search.support.microsoft.com/kb/c.asp?fr=0&SD=GN&LN=EN-US
>
> In the Article ID Number enter Q167223 and download Auto97.exe and
> install it.
> If you want automation for Office2K or OfficeXP then it's Article ID
> Number Q253338 and the file is OffAutmn.exe. Even though this program is
> for Access97 also, I find Auto97.exe much more useful and easier to find
> things.
>
>
>
> John V. Ruff - The Eternal Optimist :-)
Message #13 by "John Ruff" <papparuff@c...> on Mon, 26 Nov 2001 16:16:31 -0800
|
|
Ok Tammy, here we go.
Here is your code:
Private Const m_strDIR As String = " K:\DATA\PRIVATE\Iscs\Templates\"
Private Const m_strTEMPLATE As String
"ServiceCenterUserIDRequestForm.dot"
Private m_objWord As Word.Application
Private m_objDoc As Word.Document
Public Sub CreateSCIDRequestDoc()
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
m_objWord.PrintOut Background:=False
m_objDoc.SaveAs FileName:=m_strDIR & "User ID Request for" & ".doc"
m_objDoc.Close
m_objWord.Quit
Set m_objDoc = Nothing
Set m_objWord = Nothing
End Sub
Here is my code
Private Const m_strDIR As String = "K:\DATA\PRIVATE\Iscs\Templates\"
Private Const m_strTEMPLATE As String
"ServiceCenterUserIDRequestForm.dot"
Public Sub CreateSCIDRequestDoc()
Static WordObj As Word.Application
Dim strSaveDir As String
dim StrFileName As String
' Directory to save the file _
Do not save it in the Templates folder _
Place it in a completely folder. _
I placed the file in My Documents, in _
the Test directory
strSaveDir = "C:\Documents and Settings\Administrator\My
Documents\Test\"
strFileName = "User ID Request for Papparuff.doc"
Set WordObj = Nothing
Set WordObj = CreateObject("Word.Application")
' Open the template
WordObj.Documents.Open (m_strDIR & m_strTEMPLATE)
'Enable viewing the Word session and its document
WordObj.Visible = True
' Save the template to a .doc file before user can use it.
ActiveDocument.SaveAs FileName:=strSaveFile & strFileName
' You do not have to set WordObj to nothing because _
when the user closes Word, it's instance will be _
destroyed.
End Sub
If you want the user to print the document after they have closed it,
then add a button on your form to permit them to print it. (They can
also print it before they close Word.)
John Ruff - The Eternal Optimist :-)
-----Original Message-----
From: Tammy Tappan [mailto:GRTappan@e...]
Sent: Monday, November 26, 2001 11:18 PM
To: Access
Subject: [access] Re: Run-time error '5137': This document template does
not- exist
Okay, you lost me! =) I'm REALLY new at VBA, so bear with me.
If I change all my code to what you have below, how does it open my
template as a document to be filled in & saved? Or, am I just supposed
to
add some of that to my existing code?
+Tammy
(Always a Pollyanna, 'cuz I know we're gonna get this thing to work
yet!)
> Tammy,
>
> Here is what the MS Automation 97 Help file says about keeping Word
> open
>
> Opening a Microsoft Word Document
>
> This example demonstrates how to use Automation to open Microsoft Word
> and a document for viewing. Note the use of the Static keyword to
> prevent the object variable from losing scope. Once the object
> variable loses scope, the instance of Microsoft Word is destroyed.
>
> Sub OpenWordDoc()
> Static WordObj As Word.Application
> Set WordObj = Nothing
> Set WordObj = CreateObject("Word.Application")
> WordObj.Documents.Open ("C:\My Documents\Test.doc")
>
> 'Enable viewing the Word session and its document
> WordObj.Visible = True
> End Sub
>
> So, if you use Static, the word document will remain open for the
> user.
>
> MS Automation 97 Help is an excellent program for Automation and most
> of it also relates to Office2K and OfficeXP.
> Go to http://search.support.microsoft.com/kb/c.asp?fr=0&SD=GN&LN=EN-US
>
> In the Article ID Number enter Q167223 and download Auto97.exe and
> install it. If you want automation for Office2K or OfficeXP then it's
> Article ID Number Q253338 and the file is OffAutmn.exe. Even though
> this program is for Access97 also, I find Auto97.exe much more useful
> and easier to find things.
>
>
>
> John V. Ruff - The Eternal Optimist :-)
---
You are currently subscribed to access as: papparuff@c... To
unsubscribe send a blank email to $subst('Email.Unsub')
Message #14 by "Tammy Tappan" <GRTappan@e...> on Tue, 27 Nov 2001 18:16:01
|
|
Well, you're a genious!! Or at least an excellent programmer! =)
Okay, 3 last minor details:
1) When I run the procedure in the Immediate Window, everything works
okay; however, I'm returned to the Immediate Window rather than remaining
on the document - will this change once the procedure is assigned to
something in the database?
2) Speaking of "something in the database", I'd like this procedure to run
from a simple command button - do I assign the module directly to the
button? If so, how? Or, should I do a macro to run the module, & then
assign the macro to the button?
3) When I closed the document, it seemed to have disappeared? I assigned
it to the appropriate folder, but it wasn't there. I tried to reopen it
from Start>Documents - couldn't find it. What happened? Word let me close
the document without an additional save.
+Tammy
> Private Const m_strDIR As String = "K:\DATA\PRIVATE\Iscs\Templates\"
> Private Const m_strTEMPLATE As String
> "ServiceCenterUserIDRequestForm.dot"
>
>
> Public Sub CreateSCIDRequestDoc()
> Static WordObj As Word.Application
> Dim strSaveDir As String
> dim StrFileName As String
>
> ' Directory to save the file _
> Do not save it in the Templates folder _
> Place it in a completely folder. _
> I placed the file in My Documents, in _
> the Test directory
> strSaveDir = "C:\Documents and Settings\Administrator\My
> Documents\Test\"
> strFileName = "User ID Request for Papparuff.doc"
>
> Set WordObj = Nothing
> Set WordObj = CreateObject("Word.Application")
>
> ' Open the template
> WordObj.Documents.Open (m_strDIR & m_strTEMPLATE)
>
> 'Enable viewing the Word session and its document
> WordObj.Visible = True
> ' Save the template to a .doc file before user can use it.
> ActiveDocument.SaveAs FileName:=strSaveDir & strFileName
>
> ' You do not have to set WordObj to nothing because _
> when the user closes Word, it's instance will be _
> destroyed.
>
> End Sub
>
|
|
 |