R
Robert_L_Ross
This is driving me crazy! I have a .dot I'm using to create forms that
connect to an Excel spreadsheet (to populate a userform drop down box).
I want to have three custom properties I can use anywhere in the document
(one is for the path to the Excel data source, one is the location to save
the completed forms and one is the location of the document template for
opening new blank forms).
Two of my three custom properties work fine (data source and destination
path). I cannot get the document template location to work. I want to have
these set in one place so if we need to move/copy the form, data source or
change the destination path, all we need to do is change the custom
properties, not the code.
Here's my custom properties:
Name: SourceFile
Type: Text
Value: G:\GS-220\SLATE\CORRECTION_SHEETS\SCHOOL_LIST.xls
Name: TemplateFile
Type: Text
Value: G:\GS-220\SLATE\CORRECTION_SHEETS\Correction_Sheet.dot
Name: CompletedDestination
Type: Text
Value: G:\GS-220\SLATE\CORRECTION_SHEETS\CompletedForms\
The SourceFile and CompletedDestination work fine, but the TemplateFile
gives me a Run-time error 13, Type mismatch.
Here's the code where I call it from:
Sub NEWFORM()
Dim CURRENTDOCNAME As String
CURRENTDOCNAME = ActiveDocument.FullName
Word.Documents.Add ActiveDocument.CustomDocumentProperties("TemplateFile")
Documents(CURRENTDOCNAME).Close
End Sub
Can anyone tell me what it is that I'm doing wrong?!?
connect to an Excel spreadsheet (to populate a userform drop down box).
I want to have three custom properties I can use anywhere in the document
(one is for the path to the Excel data source, one is the location to save
the completed forms and one is the location of the document template for
opening new blank forms).
Two of my three custom properties work fine (data source and destination
path). I cannot get the document template location to work. I want to have
these set in one place so if we need to move/copy the form, data source or
change the destination path, all we need to do is change the custom
properties, not the code.
Here's my custom properties:
Name: SourceFile
Type: Text
Value: G:\GS-220\SLATE\CORRECTION_SHEETS\SCHOOL_LIST.xls
Name: TemplateFile
Type: Text
Value: G:\GS-220\SLATE\CORRECTION_SHEETS\Correction_Sheet.dot
Name: CompletedDestination
Type: Text
Value: G:\GS-220\SLATE\CORRECTION_SHEETS\CompletedForms\
The SourceFile and CompletedDestination work fine, but the TemplateFile
gives me a Run-time error 13, Type mismatch.
Here's the code where I call it from:
Sub NEWFORM()
Dim CURRENTDOCNAME As String
CURRENTDOCNAME = ActiveDocument.FullName
Word.Documents.Add ActiveDocument.CustomDocumentProperties("TemplateFile")
Documents(CURRENTDOCNAME).Close
End Sub
Can anyone tell me what it is that I'm doing wrong?!?