QUOTE]
Thank you all for you help. Debugging is a humbling experience.
The cause of the error is an incorrect path to the template I was opening the new document with. When I split the creation of the document into 2 steps -- creating it and then associating it with the template VB was quick to point out that it could not attach the template because it couldn't find it.
If the original SET command had failed for...
User Profile
Collapse
-
[color=#b1b100][/color]Code:[color=#b1b100]Set[/color] robjNewDocument = objWordApplication.[color=#66cc66]Documents[/color].[color=#66cc66]add[/color][color=#66cc66]([/color]strTemplateName[color=#66cc66])[/color]
[color=#b1b100][/color]
[color=#b1b100] [/color]
[color=#b1b100][/color]
[color=#b1b100][/color]Code:[color=#b1b100]GGADebug = robjNewDocument.FullName[/color]
[color=#b1b100][/color]
[color=#b1b100] [/c...Leave a comment:
-
Thanks for a quick response!
The routine is actually called from the open document. The application is a dll that gets attached to the documents via the templates. The line of code that fails is:
‘Fails on the next line
writeToDocument robjNewDocument , strArrayBookmar kNames(I), _
However, even asking VB to return the documents name causes the error. I don't know how to set the debug but will...Leave a comment:
-
VB6 - Error 91 Object or Block Variable Not Set
My application creates Word documents. The routine below takes an existing, open document (vobjSourceDocu ment) and makes a new document (robjNewDocumen t) similar to it. The routine works 999+ times out of 1000. I cannot find any pattern regarding document type (template) or qualities of the source document, but once I have a source document that fails it will fail consistenly on any workstation.
In the code sample below it is trying...
No activity results to display
Show More
Leave a comment: