Memory problem with SynonimInfo

P

Prudencio

With VBA, I have to know the list of Synonims of a word Wrd. I use the
following code, but I see that the free memory of system decrease of about
300 bytes for each invocation of SunonimInfo. Since I have to evaluate the
list of synonim for thousand of words, I have a memori problem.
Anyone know how memory can be recovered?

Thank you, however.


Private Function FirstValidSynonim(Wrd As String)
Dim SynCount As Integer
Dim SynList As Variant

SynCount = SynonymInfo(Wrd, wdItalian).MeaningCount
If SynCount > 0 Then
SynList = SynonymInfo(Wrd, wdItalian).MeaningList
End If

If SynCount > 0 Then
for i = 1 to SynCount
'Search if SynList(i) is already in database
next
End If
Set SynList = Nothing
End Function
 
S

Steve Hudson

G'day "Prudencio" <[email protected]>,

destroy all objects

thus, end your func with

Set SynList = Nothing


Prudencio said:
With VBA, I have to know the list of Synonims of a word Wrd. I use the
following code, but I see that the free memory of system decrease of about
300 bytes for each invocation of SunonimInfo. Since I have to evaluate the
list of synonim for thousand of words, I have a memori problem.
Anyone know how memory can be recovered?

Thank you, however.


Private Function FirstValidSynonim(Wrd As String)
Dim SynCount As Integer
Dim SynList As Variant

SynCount = SynonymInfo(Wrd, wdItalian).MeaningCount
If SynCount > 0 Then
SynList = SynonymInfo(Wrd, wdItalian).MeaningList
End If

If SynCount > 0 Then
for i = 1 to SynCount
'Search if SynList(i) is already in database
next
End If
Set SynList = Nothing
End Function

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 
P

Prudencio

OK, but my problem is the destruction of the SynonimInfo Object.
What is the command to destroy the SynonimInfo object?

Thank you!
 
W

Word Heretic

G'day "Prudencio" <[email protected]>,

only destroy your OWN objects - not Word's lol :)

Your variant is the only object declaration thus it needs to go.

You can also try a document.undoclear


Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: Steve at wordheretic.com


Prudencio was spinning this yarn:
OK, but my problem is the destruction of the SynonimInfo Object.
What is the command to destroy the SynonimInfo object?

Thank you!

Steve Hudson

Word Heretic, Sydney, Australia

wordheretic.com

If answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 

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