Word 2007 - API Failure

M

Michael Cessna

[Environment]
Windows XP SP2
Word 2007 Beta 2

I'm getting a catastrophic failure when trying to set the
Application.Options.SaveNormalPrompt to False via the Word OleAutomation
API. I've also had the same error when trying to set other Options, such as
AllowFastSave. I've tried setting security to low and to trust the vba
project...but it didn't help. Any ideas?

Thanks.

Mike
 
J

Jean-Guy Marcil

Michael Cessna was telling us:
Michael Cessna nous racontait que :
[Environment]
Windows XP SP2
Word 2007 Beta 2

I'm getting a catastrophic failure when trying to set the
Application.Options.SaveNormalPrompt to False via the Word
OleAutomation API. I've also had the same error when trying to set
other Options, such as AllowFastSave. I've tried setting security to
low and to trust the vba project...but it didn't help. Any ideas?


Did you try with Word 2003?
Remember that this is Beta software... there are still bugs lurking
within... Not that there won't be any in the official first release, but
now, at least, they have an excuse! :)

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
C

Cindy M -WordMVP-

Hi Michael,
[Environment]
Windows XP SP2
Word 2007 Beta 2

I'm getting a catastrophic failure when trying to set the
Application.Options.SaveNormalPrompt to False via the Word OleAutomation
API. I've also had the same error when trying to set other Options, such as
AllowFastSave. I've tried setting security to low and to trust the vba
project...but it didn't help. Any ideas?
Using which programming environment? Show us your code to instantiate Word and
(presumably) set an option that's failing.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
M

Michael Cessna

Hi,

Yes, the code in question has been tested with Word 2000, Word XP, and Word
2003. Its part of a commercial app and the code has been used a lot. I'm in
the process of qualifying parts of our app for Word 2007.

Thanks.

Mike

Jean-Guy Marcil said:
Michael Cessna was telling us:
Michael Cessna nous racontait que :
[Environment]
Windows XP SP2
Word 2007 Beta 2

I'm getting a catastrophic failure when trying to set the
Application.Options.SaveNormalPrompt to False via the Word
OleAutomation API. I've also had the same error when trying to set
other Options, such as AllowFastSave. I've tried setting security to
low and to trust the vba project...but it didn't help. Any ideas?


Did you try with Word 2003?
Remember that this is Beta software... there are still bugs lurking
within... Not that there won't be any in the official first release, but
now, at least, they have an excuse! :)

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
M

Michael Cessna

Cindy,

We're using Delphi 7 for the development. The code in question is part of a
commercial app that has been used with Word 2000, Word XP, and Word 2003
over the past four years. We use early binding and the TLB for Word 2000 for
backward compatibility. As a test, I've also tried late binding...but it
didn't make a difference. Here's some of the code that fails:

FWordApplication := CoWordApplication.Create;

....etc.

FWordApplication.Options.SaveNormalPrompt := False;

If I comment out any of the code that accesses the Options
interface...everything runs fine.

Thanks

Mike

Cindy M -WordMVP- said:
Hi Michael,
[Environment]
Windows XP SP2
Word 2007 Beta 2

I'm getting a catastrophic failure when trying to set the
Application.Options.SaveNormalPrompt to False via the Word OleAutomation
API. I've also had the same error when trying to set other Options, such
as
AllowFastSave. I've tried setting security to low and to trust the vba
project...but it didn't help. Any ideas?
Using which programming environment? Show us your code to instantiate Word
and
(presumably) set an option that's failing.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister


This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
M

Michael Cessna

Cindy,

I've been playing around with the code and discovered a workaround. In all
previous versions of Word you could set the Application.Options without
having a document open; however, in Word 2007 you must have a document open
before you can use the Application.Options interface.

Thanks.

Mike

Cindy M -WordMVP- said:
Hi Michael,
[Environment]
Windows XP SP2
Word 2007 Beta 2

I'm getting a catastrophic failure when trying to set the
Application.Options.SaveNormalPrompt to False via the Word OleAutomation
API. I've also had the same error when trying to set other Options, such
as
AllowFastSave. I've tried setting security to low and to trust the vba
project...but it didn't help. Any ideas?
Using which programming environment? Show us your code to instantiate Word
and
(presumably) set an option that's failing.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister


This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
C

Cindy M -WordMVP-

Hi Michael,
I've been playing around with the code and discovered a workaround. In all
previous versions of Word you could set the Application.Options without
having a document open; however, in Word 2007 you must have a document open
before you can use the Application.Options interface.
Good, glad you could find a workaround. Interesting, though. When I try
setting options using Excel to automate Word I have no problems, even if no
document is opened. Ditto automating from Visual Studio (C#). I don't know if
this is a Delphi issue, or something odd about your configuration...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
M

Michael Cessna

Cindy,

I ran some more tests...and the error is only thrown if Word is "not"
visible.

The following VBScript demonstrates this:

Option Explicit

Sub Main
Dim oWord
Set oWord = CreateObject("Word.Application")
'oWord.Visible = True
oWord.Visible = False ' <--<<< Causes error when trying to set option
below.
oWord.Options.AllowFastSave = True
oWord.Quit
Set oWord = Nothing
End Sub

Call Main()

Thanks

Mike
 
C

Cindy M -WordMVP-

Hi Mike,
I ran some more tests...and the error is only thrown if Word is "not"
visible.
Hmmm. Doesn't change anything, here. By default, when you create a new
Word.Application object it's not visible. Again, on my system with VBA
and C# this makes no difference.
The following VBScript demonstrates this:

Option Explicit

Sub Main
Dim oWord
Set oWord = CreateObject("Word.Application")
'oWord.Visible = True
oWord.Visible = False ' <--<<< Causes error when trying to set option
below.
oWord.Options.AllowFastSave = True
oWord.Quit
Set oWord = Nothing
End Sub

Call Main()

Thanks

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
M

Michael Cessna

Just a follow-up. The Office 2007 Beta 2 Technical Refresh build fixed the
bug described in this newsgroup thread.

Thanks.

Mike
 

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