![]() |
#1
|
|||
|
|||
![]()
I have a document which contains a CustomUI ribbon and VBA modules to allow a user to customize the content and saves a copy of the document for each customer. I need to remove the CustomUI and the VBA components (Modules and UserForms) from the finalized document, but I have not found a reliable method to do so yet.
I tried applying the 'Normal.docm' template to the finalized document, but that seemed to work at first, but doesn't seem to be working anymore (i.e. the CustomUI is still used, and the VBA modules are still intact in the copy). I'm not sure if the file format I am saving the document may affect this or not, I am saving it as wdFormatXMLDocument. I also tried looping through the document.VBProject.VBComponents to remove them, but this requires the 'Trust access to the VBA project object model' to be checked, and I cannot be sure that the user will have this option selected. I tried saving the document in wdFormatXMLDocument (.docx format removes the VBA modules), then closing and reopening the document and saving as wdFormatDocument (.doc format removes the CustomUI), which worked fine on my computer (aside from changing the format of some of the bulleted text), but then the client was getting the 'Word cannot start the converter mswrd632.wpc' error when saving as .doc files. Is there a more reliable way to remove these parts of the document via VBA? |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
teddysika | Excel | 1 | 11-22-2012 06:06 AM |
Remove first character from text file | dwillyfan | Word VBA | 1 | 09-04-2012 08:29 PM |
How to remove password from .docx file? | erik2282 | Word | 3 | 05-29-2012 05:44 AM |
![]() |
Jamal NUMAN | Word | 1 | 07-08-2011 05:40 PM |
Problem with Workbook_Open with CustomUI | birdseye42 | Excel | 0 | 08-26-2009 11:59 AM |