Modify macro to extract acronyms

E

EM

X-No-Archive: Yes

I frequently use the macro to extract acronyms into another document posted
in http://www.thedoctools.com/index.php?show=mt_acronyms_extract. Is there a
way to put the paragraph number in the third column instead of the page
number?

.Cell(n + 1, 1).Range.Text = strAcronym
'Insert page number in column 3
.Cell(n + 1, 3).Range.Text =
oRange.Information(wdActiveEndPageNumber)

Thanks in advance.
 
D

Doug Robbins - Word MVP

Just what do you mean by the paragraph number?

Are the paragraphs numbered by the use of a style that includes the
numbering?

Is it the number of the paragraph on that page where the first paragraph or
part paragraph on that page would be paragraph 1?

Is it the number of the paragraph in the document where the first paragraph
in the document will be paragraph 1?

--
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, originally posted via msnews.microsoft.com
 
E

EM

X-No-Archive: Yes
numbering?
Is it the number of the paragraph in the document where the first paragraph
in the document will be paragraph 1?<<

Yes, the paragraphs are numbered with a style that includes the
numbering and the first paragraph in the document will be paragraph 1.

--
 
D

Doug Robbins - Word MVP

Use:

oDoc_Source.ConvertNumberstoText

and then use:

.Cell(n + 1, 1).Range.Text = strAcronym
.Cell(n + 1, 3).Range.Text = Left(oRange.Paragraphs(1).Range,
InStr(oRange.Paragraphs(1).Range, Chr(9)))

At the end I would add:

oDoc_Source.Close savechanges:=wdDoNotSaveChanges

to close the source document without change of converting the numbers to
text.

--
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, originally posted via msnews.microsoft.com
 
E

EM

X-No-Archive: Yes

Worked perfectly, Thanks a lot.

---

oDoc_Source.ConvertNumberstoText
and then use:
.Cell(n + 1, 1).Range.Text = strAcronym
.Cell(n + 1, 3).Range.Text = Left(oRange.Paragraphs(1).Range,
InStr(oRange.Paragraphs(1).Range, Chr(9)))<<
 
D

Doug Robbins - Word MVP

You're welcome.

--
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, originally posted via msnews.microsoft.com
 

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