Accessing Structured Document Tags (SDT)

P

p0

Hello,

Is there a way to access the content (and properties) of structured
document tags in VBA?

TIA,

Yves
 
D

Doug Robbins - Word MVP

Exactly what do you mean by Structured Document Tags?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
P

p0

OOXML defines a Structured Document Tag element. The tag normally
contains two children, one contains the properties, the other is the
content to display. Content controls often use SDTs to present the
information. Visually, SDTs are often marked in Word 2007 as the blue
bounding boxes with extra options (convert to static text, ...) that
appear around some parts of the text. What I want to do is access
*ALL* SDTs in my document and check the type. And then based on the
type, do something with the content.

As said, I want to check *ALL* SDTs, not only the content controls.
Hence, ActiveDocument.ContentControls is of no use to me.

Is it actually possible to access the XML part of the document? I'm
not talking custom xml, just the main document. If so, I could iterate
over all nodes till I find a <w:sdt> and then change its children in
the way I want.

Yves
 
P

p0

Thanks for the link, but it's not what I want to achieve.

The problem is not handling XML, the problem is handling the XML from
inside the document. I can get to the XML using
ActiveDocument.WordOpenXML but that doesn't allow me to change it. I
can create an external software program, load the docx and process it.
The thing is, I want to do it from inside Word.

Yves
 
C

Cindy M.

Hi P0,
The problem is not handling XML, the problem is handling the XML from
inside the document. I can get to the XML using
ActiveDocument.WordOpenXML but that doesn't allow me to change it. I
can create an external software program, load the docx and process it.
The thing is, I want to do it from inside Word.
The XML property would allow you to change things, but it really targets
the Word 2003 version and doesn't always contain things added by 2007.
You can check it and find out, though.

Otherwise, you'd have to find a way to identify what you're picking up
in the WordOpenXML from the document.

But, no, the object model does not contain any way to work with the SDT
stuff directly.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top