Creating Letterhead Macro in Word 2007

C

Christine

I am new to Word 2007, having just switched from Word 2002. I am trying to
create a macro for our firm letterhead with a date and page number on the
second page. When I attempt to use the macro, I get the following error
message:

ActiveDocument.AttachedTemplate.BuildingBlockEntries(" Blank").Insert _

Where:=Selection.Range, RichText:=True

Can anyone tell me what I am doing wrong? Thanks.
 
J

Jay Freedman

I am new to Word 2007, having just switched from Word 2002. I am trying to
create a macro for our firm letterhead with a date and page number on the
second page. When I attempt to use the macro, I get the following error
message:

ActiveDocument.AttachedTemplate.BuildingBlockEntries(" Blank").Insert _

Where:=Selection.Range, RichText:=True

Can anyone tell me what I am doing wrong? Thanks.

That isn't an error message, it's just a line of macro code. I'll assume that's
the line that's highlighted in yellow when the error occurs and the VBA editor
opens, but there should be a message box that pops up first. It might say
something like "Run time error <some number>" followed by a description of the
error, like "Requested member of the collection does not exist".

Can you quote the exact wording of that message?
 
J

Jean-Guy Marcil

Jay Freedman said:
That isn't an error message, it's just a line of macro code. I'll assume that's
the line that's highlighted in yellow when the error occurs and the VBA editor
opens, but there should be a message box that pops up first. It might say
something like "Run time error <some number>" followed by a description of the
error, like "Requested member of the collection does not exist".

Can you quote the exact wording of that message?

My guess is that she used an extra space in
ActiveDocument.AttachedTemplate.BuildingBlockEntries(" Blank").Insert _
which should be
ActiveDocument.AttachedTemplate.BuildingBlockEntries("Blank").Insert _

Can building block names start with a space? Autotext entries cannot...
 

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