Deleting CustomDocumentProperties within Word from VB .Net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've hunted low and high for this and I've tried just about everything I
could find on the www. I have a template document (.dot) that thru a VB .Net
I open and fill with information. I trap the DocumentBeforeSave event so
that I can force the file to be saved to a particular location and I cancel
the SaveAsUI window. But my problem is that the .dot file gets prepopulated
with data from an XML document that I have (which is okay so far) but when I
open the .doc file that was created from the .dot template I get a message
stating the XML can not be found. I don't want the .doc looking for the XML
document becuase that was only used for loading the data into the template.
So I checked the documents properties and I notice that it has 2 custom
properties both listing the XML document. If I manually delete these
properties then subsequent opens of the .doc work fine. So how do I thru VB
..Net before saving the .dot has a .doc delete the properties?
 
Back
Top