Re: Deleting autotext from normal.dotm
- From: "Jay Freedman" <jay.freedman@xxxxxxxxxxx>
- Date: Tue, 10 Feb 2009 13:22:51 -0500
Laurel wrote:
I'm not a VB programmer, but I need to fix a VB DLL to be compatible
with Word 2007. Below is the code I've got, and a suggestion from a
colleague about how to fix it. But his suggestion won't compile. Can
anyone give me the proper syntax? I'm working in vb6, and the
code is used to create a DLL.
Note - before I put the 2/09 change in, we got the error "file not
found." After the change, we get the error "Command failed."
Note also - I see that this group is for VBA, not VB6, but it's
oriented to Word, and it seems as if Word is more relevant. But let
me know if I should re-post in the VB.General group.
'Remove the Autotext entry from NORMAL.DOT
'WordApp.OrganizerDelete Source:="Normal.dot", _ LAS-2/09-for Word
2007
WordApp.OrganizerDelete Source: =Normal.dotm", _
Name:=Current_AutoText, Object:=wdOrganizerObjectAutoText
This probably needs to look something like this (from a quick word
2007 macro):
WordApp. NormalTemplate.BuildingBlockEntries(Current_Auto_Text)Delete
THIS WON'T COMPILE
It's a syntax error. The Delete method is a member of the BuildingBlockEntry
object returned by the expression .BuildingBlockEntries(Current_Auto_Text)
so you need a dot before the Delete. You also need to remove the space (if
it's really there) after WordApp.
WordApp.NormalTemplate.BuildingBlockEntries(Current_Auto_Text).Delete
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
.
- References:
- Deleting autotext from normal.dotm
- From: Laurel
- Deleting autotext from normal.dotm
- Prev by Date: Deleting specific shapes from document using code
- Next by Date: Re: date format not formatting correct date
- Previous by thread: Deleting autotext from normal.dotm
- Next by thread: number of paragraphs with a certain style
- Index(es):
Relevant Pages
|