VBA Reference Problem?

G

George Lee

I am trying to port a VBA feature as a VBScript on a Web Page. I keep getting
an "ActiveX object can't create object: 'Word.Application'. Is this a
reference problem? How do you point the page to the where the Word reference
is?
 
P

Perry

Code snippets will do wonders.
Pls show the code.

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
 
G

George Lee

The intent is for this .htm file to sit on a share and for users to be able
to open documents on their machine. But how do you set the Word reference to
their computer?

....
dim wordApplication
set wordApplication = CreateObject("Word.Application")
wordApplication.Visible = True

dim gSourceWordDocument
'File1.value is the full path name to a .doc file
set gSourceWordDocument = wordApplication.Documents.Open(File1.value)
....
 
P

Perry

Do you want to open an .HTM file in IE using VBScript?

Why not navigate to the .HTM file then:

dim oExplorer
open_HTM
sub open_HTM()
Set oExplorer = Createobject("InternetExplorer.Application")
with oexplorer
.navigate "c:\AnyPath\test.htm"
...etc


--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
 
P

Perry

If you want to open in MS Word, the problem isn't yr code.
This should work.

If you save the VBScript as a VBS file and run it, does it come up with MS
Word and the document?

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
 
G

George Lee

I stil get the same error message. But then again, the network share it's on
is not the same machine where the file is being opened at.
 

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