Re: Deleting autotext from normal.dotm

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.


.



Relevant Pages

  • Re: VB6, VB2005, or Something Else?
    ... So any VB6 successor is free to break compatibility to COM ... That doesn't imply that the "old syntax" couldn't be supported and that the new one couldn't support native code compilation. ... But I think it's a myth that you simply can take your native code and compile it to managed one and expect it to be the same as if you would re-engineer the whole application and rewrite it in .NET. ... But I also stated that this would break compatibility in many ways. ...
    (microsoft.public.vb.general.discussion)
  • Re: How do I find and use the window handle of an external application?
    ... still dependent on API calls to get the external window dimensions. ... does only take a few well-aimed lines of code to do the trick in VB6, ... If you know the caption of the Window then you can use FindWindowEx ... compile it for me as an .exe or .dll? ...
    (microsoft.public.vb.winapi)
  • Re: Using a Combo Box to Find Records
    ... I didn't know you understood Jeanette's suggestion based on what you wrote. ... control name in actual code. ... Leftwould generate a compile error because you need to specify ... Private Sub CboMoveTo_AfterUpdate ...
    (microsoft.public.access.forms)
  • Re: Restore VB
    ... When I try to start the app in the IDE I get the message with Ctrl-F5 ... So I figure some VB6 related .DLL or something has been hosed. ... the compile project will run without error ... install packages to update them. ...
    (microsoft.public.vb.general.discussion)
  • Interop different depending on how component is started
    ... I have a component written in VB6. ... If I compile the component to native code everything works fine. ... VS.NET IDE. ... DLL file does have GetEnumeratefor the collections. ...
    (microsoft.public.dotnet.framework.interop)