Range could not be deleted

Q

Quantum

Dim DateBegin As Date
Dim DateEnd As Date
DateBegin = TxtBeginDisability
DateEnd = DateBegin + 2
StrDateEnd = Str(DateEnd)
ActiveDocument.Bookmarks("txtEndDisabilityDate").Range.Text = Str(DateEnd)

give error

the range could not be deleted.

Why?
 
J

Jean-Guy Marcil

Quantum was telling us:
Quantum nous racontait que :
Dim DateBegin As Date
Dim DateEnd As Date
DateBegin = TxtBeginDisability
DateEnd = DateBegin + 2
StrDateEnd = Str(DateEnd)
ActiveDocument.Bookmarks("txtEndDisabilityDate").Range.Text =
Str(DateEnd)

give error

the range could not be deleted.

I tried

Dim DateBegin As Date
Dim DateEnd As Date

DateBegin = Now
DateEnd = DateBegin + 2
StrDateEnd = Str(DateEnd)
ActiveDocument.Bookmarks("txtEndDisabilityDate").Range.Text = Str(DateEnd)

and I did not get an error.

What do you have in the document at the bookmark?
Where is the bookmark?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top