Hi
I have a problem using Visual Basic for Word.
I have a form, from which the user can select from a list of documents (variable=lstMergeDocument). Whenever they change their selection, the macro examines the custom properties in the selected document (which isn't open at that time).
The relevant code starts like this:
<pre>Private Sub lstMergeDocument_Change()
Dim MyWordFile As Object, MyProperty$
If Trim$(lstMergeDocument) = "" Then GoTo Finish
Set MyWordFile = GetObject(ActiveDocument.Path + Application.PathSeparator + "Subdocs" _
+ Application.PathSeparator + lstMergeDocument + ".doc")
</pre>
The last statement (Set MyWordFile ...) usually, but not always, causes this error:
<hr>Runtime error 287. Appication-defined or object-defined error<hr>
Note: The code within parentheses (activedocument .... doc) evaluates correctly.
Any ideas?
Dale



