Since I installed Office 2007 beta (latest one on May 26th), I am unable to
access the HTMLProject property of a Word Document object using VB6. I get
"Application Defined Error" if I view it using Watch. I get method of ~
failed when running the program. Basically the code is:

Set WordApp = CreateObject("Word.Application")
Set worddoc = WordApp.Documents.Add
Set prjItem = worddoc.HTMLProject.HTMLProjectItems.Item(1)

This code works fine in Word 2000, XP and 2003.

Any ideas what may be wrong?

Thanks
Kevin O'Brien

Re: HTMLProject and Office 2007 by Klaus

Klaus
Mon May 29 12:27:09 CDT 2006

Hi Kevin,

AFAIK MS scrapped the script editor and everything that has to do with it
completely.
Sorry for the bad news... but you probably will have to switch to the new
XML stuff.
Or save as HTML and get the HTML source from there.

Greetings,
Klaus



"ai38kpo" <ai38kpo@discussions.microsoft.com> wrote:
> Since I installed Office 2007 beta (latest one on May 26th), I am unable
> to
> access the HTMLProject property of a Word Document object using VB6. I get
> "Application Defined Error" if I view it using Watch. I get method of ~
> failed when running the program. Basically the code is:
>
> Set WordApp = CreateObject("Word.Application")
> Set worddoc = WordApp.Documents.Add
> Set prjItem = worddoc.HTMLProject.HTMLProjectItems.Item(1)
>
> This code works fine in Word 2000, XP and 2003.
>
> Any ideas what may be wrong?
>
> Thanks
> Kevin O'Brien



Re: HTMLProject and Office 2007 by ai38kpo

ai38kpo
Mon May 29 12:49:01 CDT 2006

Klaus,
I am not using the script editor. I am accessing the object model through
VB6. The property exists but does not appear to be accessible. What I am
trying to do is to insert HTML into a document programatically.

Thanks
Kevin

"Klaus Linke" wrote:

> Hi Kevin,
>
> AFAIK MS scrapped the script editor and everything that has to do with it
> completely.
> Sorry for the bad news... but you probably will have to switch to the new
> XML stuff.
> Or save as HTML and get the HTML source from there.
>
> Greetings,
> Klaus
>
>
>
> "ai38kpo" <ai38kpo@discussions.microsoft.com> wrote:
> > Since I installed Office 2007 beta (latest one on May 26th), I am unable
> > to
> > access the HTMLProject property of a Word Document object using VB6. I get
> > "Application Defined Error" if I view it using Watch. I get method of ~
> > failed when running the program. Basically the code is:
> >
> > Set WordApp = CreateObject("Word.Application")
> > Set worddoc = WordApp.Documents.Add
> > Set prjItem = worddoc.HTMLProject.HTMLProjectItems.Item(1)
> >
> > This code works fine in Word 2000, XP and 2003.
> >
> > Any ideas what may be wrong?
> >
> > Thanks
> > Kevin O'Brien
>
>
>

Re: HTMLProject and Office 2007 by Klaus

Klaus
Mon May 29 16:25:21 CDT 2006

It was in the Object Model because of the script editor.
I have currently similiar problems... Say, context menus no longer allow
edit controls, dropdown controls or combo boxes, just buttons and popups.
So my old code from 2003 doesn't work any more.

Similar for the old file search, versions, AutoSummarize, ... which don't
exist any more (AFAIK).

worddoc.HTMLProject.HTMLProjectItems.Item(1) did little more than convert
the doc to HTML, write that to a temporary file, and give you the text.
You will have to do that yourself now.

Regards,
Klaus


"ai38kpo" wrote:
> Klaus,
> I am not using the script editor. I am accessing the object model
> through
> VB6. The property exists but does not appear to be accessible. What I am
> trying to do is to insert HTML into a document programatically.
>
> Thanks
> Kevin
>
> "Klaus Linke" wrote:
>
>> Hi Kevin,
>>
>> AFAIK MS scrapped the script editor and everything that has to do with it
>> completely.
>> Sorry for the bad news... but you probably will have to switch to the new
>> XML stuff.
>> Or save as HTML and get the HTML source from there.
>>
>> Greetings,
>> Klaus
>>
>>
>>
>> "ai38kpo" <ai38kpo@discussions.microsoft.com> wrote:
>> > Since I installed Office 2007 beta (latest one on May 26th), I am
>> > unable
>> > to
>> > access the HTMLProject property of a Word Document object using VB6. I
>> > get
>> > "Application Defined Error" if I view it using Watch. I get method of ~
>> > failed when running the program. Basically the code is:
>> >
>> > Set WordApp = CreateObject("Word.Application")
>> > Set worddoc = WordApp.Documents.Add
>> > Set prjItem = worddoc.HTMLProject.HTMLProjectItems.Item(1)
>> >
>> > This code works fine in Word 2000, XP and 2003.
>> >
>> > Any ideas what may be wrong?
>> >
>> > Thanks
>> > Kevin O'Brien
>>
>>
>>



Re: HTMLProject and Office 2007 by ai38kpo

ai38kpo
Mon May 29 17:10:02 CDT 2006

Klaus,
Thank you. This means that quite a few applications are going to be
broken in this release. What I am doing is inserting HTML into a Word
document. Do you have any suggestions as to how I can now do this?

Kevin

"Klaus Linke" wrote:

> It was in the Object Model because of the script editor.
> I have currently similiar problems... Say, context menus no longer allow
> edit controls, dropdown controls or combo boxes, just buttons and popups.
> So my old code from 2003 doesn't work any more.
>
> Similar for the old file search, versions, AutoSummarize, ... which don't
> exist any more (AFAIK).
>
> worddoc.HTMLProject.HTMLProjectItems.Item(1) did little more than convert
> the doc to HTML, write that to a temporary file, and give you the text.
> You will have to do that yourself now.
>
> Regards,
> Klaus
>
>
> "ai38kpo" wrote:
> > Klaus,
> > I am not using the script editor. I am accessing the object model
> > through
> > VB6. The property exists but does not appear to be accessible. What I am
> > trying to do is to insert HTML into a document programatically.
> >
> > Thanks
> > Kevin
> >
> > "Klaus Linke" wrote:
> >
> >> Hi Kevin,
> >>
> >> AFAIK MS scrapped the script editor and everything that has to do with it
> >> completely.
> >> Sorry for the bad news... but you probably will have to switch to the new
> >> XML stuff.
> >> Or save as HTML and get the HTML source from there.
> >>
> >> Greetings,
> >> Klaus
> >>
> >>
> >>
> >> "ai38kpo" <ai38kpo@discussions.microsoft.com> wrote:
> >> > Since I installed Office 2007 beta (latest one on May 26th), I am
> >> > unable
> >> > to
> >> > access the HTMLProject property of a Word Document object using VB6. I
> >> > get
> >> > "Application Defined Error" if I view it using Watch. I get method of ~
> >> > failed when running the program. Basically the code is:
> >> >
> >> > Set WordApp = CreateObject("Word.Application")
> >> > Set worddoc = WordApp.Documents.Add
> >> > Set prjItem = worddoc.HTMLProject.HTMLProjectItems.Item(1)
> >> >
> >> > This code works fine in Word 2000, XP and 2003.
> >> >
> >> > Any ideas what may be wrong?
> >> >
> >> > Thanks
> >> > Kevin O'Brien
> >>
> >>
> >>
>
>
>

Re: HTMLProject and Office 2007 by Klaus

Klaus
Mon May 29 18:45:24 CDT 2006

Are these valid HTML files you want to insert? Or fragments?
I guess you have the HTML in some string?

There seem to be two possibilities:
-- Save the HTML in a HTML file (if it isn't there already) and insert the
file (.InsertFile).
-- Try to get the HTML onto the clipboard and paste.

The latter is more difficult, but likely to be faster.
You could google the vba newsgroups for something -- I think something like
this came up a few times.
<http://groups.google.com/groups?q=vba+string+clipboard+HTML+group%3Amicrosoft.public.*>
(Maybe you can figure out a better search)

Regards,
Klaus



"ai38kpo" wrote:
> Klaus,
> Thank you. This means that quite a few applications are going to be
> broken in this release. What I am doing is inserting HTML into a Word
> document. Do you have any suggestions as to how I can now do this?
>
> Kevin
>
> "Klaus Linke" wrote:
>
>> It was in the Object Model because of the script editor.
>> I have currently similiar problems... Say, context menus no longer allow
>> edit controls, dropdown controls or combo boxes, just buttons and popups.
>> So my old code from 2003 doesn't work any more.
>>
>> Similar for the old file search, versions, AutoSummarize, ... which don't
>> exist any more (AFAIK).
>>
>> worddoc.HTMLProject.HTMLProjectItems.Item(1) did little more than convert
>> the doc to HTML, write that to a temporary file, and give you the text.
>> You will have to do that yourself now.
>>
>> Regards,
>> Klaus
>>
>>
>> "ai38kpo" wrote:
>> > Klaus,
>> > I am not using the script editor. I am accessing the object model
>> > through
>> > VB6. The property exists but does not appear to be accessible. What I
>> > am
>> > trying to do is to insert HTML into a document programatically.
>> >
>> > Thanks
>> > Kevin
>> >
>> > "Klaus Linke" wrote:
>> >
>> >> Hi Kevin,
>> >>
>> >> AFAIK MS scrapped the script editor and everything that has to do with
>> >> it
>> >> completely.
>> >> Sorry for the bad news... but you probably will have to switch to the
>> >> new
>> >> XML stuff.
>> >> Or save as HTML and get the HTML source from there.
>> >>
>> >> Greetings,
>> >> Klaus
>> >>
>> >>
>> >>
>> >> "ai38kpo" <ai38kpo@discussions.microsoft.com> wrote:
>> >> > Since I installed Office 2007 beta (latest one on May 26th), I am
>> >> > unable
>> >> > to
>> >> > access the HTMLProject property of a Word Document object using VB6.
>> >> > I
>> >> > get
>> >> > "Application Defined Error" if I view it using Watch. I get method
>> >> > of ~
>> >> > failed when running the program. Basically the code is:
>> >> >
>> >> > Set WordApp = CreateObject("Word.Application")
>> >> > Set worddoc = WordApp.Documents.Add
>> >> > Set prjItem = worddoc.HTMLProject.HTMLProjectItems.Item(1)
>> >> >
>> >> > This code works fine in Word 2000, XP and 2003.
>> >> >
>> >> > Any ideas what may be wrong?
>> >> >
>> >> > Thanks
>> >> > Kevin O'Brien
>> >>
>> >>
>> >>
>>
>>
>>