Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

VBA Reference Problem?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
George Lee - 17 Apr 2007 17:14 GMT
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?
Perry - 17 Apr 2007 19:49 GMT
Code snippets will do wonders.
Pls show the code.

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE

>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?
George Lee - 17 Apr 2007 21:26 GMT
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)
...

> Code snippets will do wonders.
> Pls show the code.
[quoted text clipped - 13 lines]
> > reference
> > is?
Perry - 17 Apr 2007 22:39 GMT
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

> The intent is for this .htm file to sit on a share and for users to be
> able
[quoted text clipped - 29 lines]
>> > reference
>> > is?
Perry - 17 Apr 2007 22:44 GMT
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

> The intent is for this .htm file to sit on a share and for users to be
> able
[quoted text clipped - 29 lines]
>> > reference
>> > is?
George Lee - 20 Apr 2007 19:12 GMT
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.

> If you want to open in MS Word, the problem isn't yr code.
> This should work.
[quoted text clipped - 43 lines]
> >> > reference
> >> > is?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.