calendar in word

K

Kim K

I have created a calendar for my form, however it works well in a new
document and not in my form. I belive it has something to do wtih the fact
that my form has several protected areas - the areaas where the date is to go
gives me a VB system error message &H80004005 (-2147467259) Unspecified error.

I think this is realted to the areas or sections that are protected although
none of the sections where the calendar is to populate is protected. How can
I get this to work properly?

I want the to place the macro where all the dates are to go on this form.
 
S

Shauna Kelly

Hi Kim

Is the calendar an AutoText? If so, try .Select -ing the range before
inserting the AutoText, eg:

Dim oRange as Word.Range
Dim oAT as Word.AutoTextEntry

set oRange = Selection.Range 'or some such
set oAT = 'get a reference to your AutoText somehow

'Select the range first
oRange.Select

'Insert the AutoText
oAT.Insert Where:=oRange, RichText:=True

Alternatively, try unprotecting the document before inserting the
calendar, and then re-protect as required.

If that doesn't solve the problem, post back with the relevant code and
identify which line of code causes the error.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
K

Kim K

Hi Shauna,

Thank you for your help, I was able to get my calendar to work but am faced
with another problem. In my efforts to create this, I created the popup
calendar in a blank template that now is associated with my form so that when
I share the form with otuer users the calendar does not work.

Can you please help or take a look for me? I need to learn this as I have
several more templates to make up in the next few weeks for work and
desperation is starting to set in!

I am sorry if this posts 2ce, I guess I got ansy with teh post button!
--
Thanks,,
Kim


Shauna Kelly said:
Hi Kim

Is the calendar an AutoText? If so, try .Select -ing the range before
inserting the AutoText, eg:

Dim oRange as Word.Range
Dim oAT as Word.AutoTextEntry

set oRange = Selection.Range 'or some such
set oAT = 'get a reference to your AutoText somehow

'Select the range first
oRange.Select

'Insert the AutoText
oAT.Insert Where:=oRange, RichText:=True

Alternatively, try unprotecting the document before inserting the
calendar, and then re-protect as required.

If that doesn't solve the problem, post back with the relevant code and
identify which line of code causes the error.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
S

Shauna Kelly

Hi Kim

Can you explain what you're actually doing here:

1. What version of Word?
2. When you say 'form' do you mean 'a document that users fill in' or a
dialog box (ie a UserForm)?
3. When you say 'calendar' what do you mean? Where did the calendar come
from?

Shauna

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word




Kim K said:
Hi Shauna,

Thank you for your help, I was able to get my calendar to work but am
faced
with another problem. In my efforts to create this, I created the
popup
calendar in a blank template that now is associated with my form so
that when
I share the form with otuer users the calendar does not work.

Can you please help or take a look for me? I need to learn this as I
have
several more templates to make up in the next few weeks for work and
desperation is starting to set in!

I am sorry if this posts 2ce, I guess I got ansy with teh post button!
 

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