fullname macro trouble

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This macro

Sub AutoOpen()
ActiveWindow.Caption = ActiveDocument.FullName
End Sub

is causing this error:

"Object variable or With block variable not set"

Any ideas why?
Office Word 2003
Windows XP Professional
 
Not a clue - that is exactly what I have. (It works in 2007 also.)

You might try repairing your installation of Office. (Help, Detect and
Repair.)

--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message was posted to a newsgroup, Please post replies and questions
to the group so that others can learn as well.
This macro

Sub AutoOpen()
ActiveWindow.Caption = ActiveDocument.FullName
End Sub

is causing this error:

"Object variable or With block variable not set"

Any ideas why?
Office Word 2003
Windows XP Professional
 
I can run the macro manually with no problems after the document is open. But
the AutoOpen macro gives the error.
 
Hi Gitche Gumee,

Is your macro stored in the document's ThisDocument module? If it is, move
it out of there into a standard code module. (If necessary, insert a code
module for this purpose by Insert/Module.)

Cheers.

Ed
 
It's in ThisDocument of Normal.dot.

I changed it to Application.ActiveWindow.Caption =
Application.ActiveDocument.FullName and it now works.
 
Hi again,

Glad you got it to work.

Cheers.

Ed

Gitche Gumee said:
It's in ThisDocument of Normal.dot.

I changed it to Application.ActiveWindow.Caption =
Application.ActiveDocument.FullName and it now works.
 

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

Back
Top