VBA access to Header references ?

R

richardchaven

I am writing a macro that translates Word documents to PmWiki format.

I want to convert cross-references to internal page links. I find no
information about any collection of the existing references. The only
information I find is about how to insert new references.

Any ideas ?
 
P

Peter Jamieson

Where is the specification of the "PmWiki format"? I looked at the website,
but there is no obvious pointer.

Peter Jamieson
 
R

richardchaven

It's a basic Wiki.

It allows intra-page links (implimented as #labels), and I want to
convert ToC and index links.
 
P

Peter Jamieson

I have a feeling I'm missing the point here, but...
a. a ToC only really contains references to text if "use hyperlinks" was
specified when it was created, in which case you may be able to follow the
reference in the HYPERLINK fields, which should point to (hidden) bookmarks.
Otherwise, there are no references - except maybe page numbers - to
anything - there's just a copy of the entries (headings, TC entries) used to
generate the ToC and a such as a page number
b.an Index field also only references page numbers - it doesn't have
pointers to the individual { XE } fields.

Peter Jamieson
 
R

richardchaven

I've already done ToC; I'm looking for the Insert | Reference |
Cross-references. I want to be able to detect them in a Range and to
figure out what they refer to.

Cheers
 
P

Peter Jamieson

They are generally references to (hidden) bookmarks, aren't they?

Peter Jamieson
 
R

richardchaven

That's it!

I had to do a bit of dancing around because they are Fields that
reference the bookmark, and while either the code ({ REF _R2343243}) or
the result ("Heading 1") appears as text, _both_ are in the Range (so
the character count does not equal the range length).

Thanks !
 

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