|
-
Oct 14th, 2021, 04:50 PM
#1
[RESOLVED] Word Template Not Found
I'm writing my first ever VSTO application, and running into a bit of an oddity. I am trying to create a document based on a template like so:
Code:
Dim newDoc = Globals.ThisAddIn.Application.Documents.Add(Template:="C:\Users\etc\SCPTemplate1.dotx")
I altered the path slightly, to hide some information, but that shouldn't matter. This throws a file not found exception, and the details state that the file in question couldn't be found.
I checked the path, and that is correct, so I then added a check using IO.File.Exists() to see whether or not the file was there. This returned True, so the file is there, and the path is completely correct.
Furthermore, while the exception pops up, the program continues past that point. A file does exist, and it even pretty much looks like the template (I'm not quite certain of that, as I may have been looking at the wrong thing, and a second issue occurs right after that which is unrelated to this problem).
So, what is this exception about? Why am I getting it when I can verify that the path is correct and the file visible? And also, why does the fact of the exception not seem to have any impact on the behavior of the addin?
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|