![]() |
Click here to advertise with us
|
|
|||||||
| Third Party Products Discussion on third party components for VB.NET |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Currently I am creating a new Word document within the vb.net code and using AttachedTemplate to indicate what template the document should be based on.
It's possible for more than one person to be doing this at once, but the second person to run this code gets the "Locked for editing" dialog with the option of opening the template as Read only etc. What I want to do is set the template to open/be attached as a read-only version (i.e. the equivalent of clicking "ok" to the Read only option). Is this possible? A small sample of the code: myWordDoc = myWordApp.Documents.Open(fullName, False, False, False) myWordDoc .AttachedTemplate = strTemplateFilename Thanks. |
|
|||
|
With a bit of help I've found an answer:
If IO.Path.GetExtension(strTemplateFilename) = ".dotx" Or IO.Path.GetExtension(strTemplateFilename) = ".dotm" Then IO.File.SetAttributes(strTemplateFilename, IO.FileAttributes.ReadOnly) End If It seems very obvious now! |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|