Bookmarks.Exist

The field called ‘CantDet’ exist in word document, but worddoc.Bookmarks.Exists(“CantDet”) retur false however worddoc.FormFields(“CantDet”).result return he content of the field.

I need to validate if the field exists.

Please help me!

set filepath

'create objet

Set word = CreateObject(“Word.Application”)

If word Is Nothing Then

Msgbox “Apperror”,16,“Error”

Exit Sub

End If

Call word.documents.add(filepath)

Set worddoc = word.activedocument

vaar = worddoc.Bookmarks.Exists(“CantDet”)

Msgbox Cstr(vaar) ’ <----- show FALSE

valor = worddoc.FormFields(“CantDet”).result

Msgbox Cstr(valor) '<---- show XXXXX

Subject: Bookmarks.Exist

then check if the field valor is NOT empty

if valor = “” then EMPTY or does not EXIST

Subject: RE: Bookmarks.Exist

The bookmark “CantDet” exist in word document but worddoc.Bookmarks.Exists(“CantDet”) return false.

Forall aBookmark In worddoc.Bookmarks

msgbox aBookmark.Name

End Forall

I added this code for seeing all bookmarks in the document but only show 8, but when i review the document i count 15 bookmarks.