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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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