Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 30th, 2005, 01:37 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , NY, USA.
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default Accessing WORD object in ASP

Hi All,

I am trying to access WORD object in ASP by using the following code
<%@ language=vbscript%>
<%
    Set oWord = CreateObject("word.application")
    oWord.Application.Visible = true

    Set oDoc = oWord.Documents.Add()

    set oWord = nothing
    set oDoc = Nothing
%>

But, I get an error message at the line;
Set oDoc = oWord.Documents.Add()

Error message: "Could not open macro storage"

Thanks for your help,

:)

MCinar

Love all the creatures because of the creator.
__________________
MCinar

Love all the creatures because of the creator.
  #2 (permalink)  
Old March 30th, 2005, 01:54 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Houston, TX, USA.
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the same problem two months ago. it's not the problem of the coding, it should be the security problem, you can try to change the setting of your internet explorer.

andraw

  #3 (permalink)  
Old March 30th, 2005, 03:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , NY, USA.
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Andraw,

What kind of setting in Internet Explorer are you referring to?

Thanks,

MCinar

Love all the creatures because of the creator.
  #4 (permalink)  
Old March 30th, 2005, 04:06 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Houston, TX, USA.
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can try changing the setting to see if it works. Go to internet explorer, tools->internet options->security->costomer level,
change the "download unsigned activeX control" from disable to enable; and "initialize and script activeX control not marked as safe" from disable to enable.

Please also check the following link concerned the server-side word automation.

http://support.microsoft.com/kb/257757

Andraw

  #5 (permalink)  
Old March 30th, 2005, 04:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , NY, USA.
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I will try them.

Thanks for your help,

MCinar

Love all the creatures because of the creator.
  #6 (permalink)  
Old March 30th, 2005, 04:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , NY, USA.
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I set Internet Explorer properly. But I still get the same error.
I also checked the link that you mentioned. I read the following. I am not sure why it still doesn't work. Here is that information;

"Opening an Office document results in one of the following errors:
Run-time error '5981' (0x800A175D): Could not open macro storage
-or-
Run-time error '1004': Method '~' of object '~' failed
Typically, this is the result of failing to initialize VBA due to insufficient permissions or due to a lack of VBA component registration, both of which are typical when a user runs code from an account with no user profile (issue #1) and the user token does not contain the Interactive SID (issue #2)."

Thanks



MCinar

Love all the creatures because of the creator.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Word through ASP.NET renoldr General .NET 2 December 2nd, 2013 06:58 AM
WORD COM object in ASP mcinar Classic ASP Basics 0 April 14th, 2005 10:34 AM
accessing word treasacrowe General .NET 8 December 14th, 2004 08:27 AM
Accessing ASP Application Object from .NET yuvalk ASP.NET 1.x and 2.0 Application Design 2 July 19th, 2004 10:29 AM
Accessing Word Object Library from .NET Web app debsoft General .NET 3 April 21st, 2004 05:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.