#1
|
|||
|
|||
Is This Possible
Backstory: I work for a learning management systems company. One of our clients use Microsoft Word to build and maintain their HTML training content. Recently they have requested we implement a special "tagging" feature, which will substitute potions of content within their HTML documents depending on what department or position an employee is in. We accomplish this by using a custom HTML element that wraps around an iframe and for the most part it works well. The problem is, when they go back to modify these documents in word they cannot see these custom elements and they are being unintentionally removed. If not unintentionally deleted, they do stay in the document after re-saving as web page filtered. The Question: Is it possible to create a VBA macro that can identify html elements in word? I haven't been able to find any information online. Ideally i'd like to create a macro that will apply styles to these elements (such as a red background, some height, and a border) when they first open the document then one to remove those once they are finished editing. Thanks for reading! |
#2
|
||||
|
||||
You haven't explained the special tagging feature so I'm not sure what you are doing but it sounds like you should investigate content controls. You can lock them so they can't be deleted accidentally. CCs are easy to work with as 'tagged elements' in a document so vba can interact with them.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Quote:
Content controls sound like they would work well but unfortunately, they do not seem to persist after saving the document as a web page. Once the document is re-opened the controls no longer exist. |
#4
|
||||
|
||||
How is the content tagged? The usual 'editing workflow' should be to work with native Word documents and export to html for each release. Editing the html files as the source for a revision loses a lot of the control and tagging.
We need to know what tagging is being used that survives saving/opening as html. If that content is there then a macro can use it.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#5
|
|||
|
|||
Quote:
Keeping a native copy of the word documents would be ideal but unfortunately we're working with 20,000-30,000 already exported pages so that ship has sailed. Our "tagging" not a word feature, we use an HTML element that's been added to the document outside of word. It looks something like this: Code:
<taggedcontent path="/Content/WHIMIS" position="employee"></taggedcontent> Thanks a lot for your help thus far by the way! |
Thread Tools | |
Display Modes | |
|