Linking to Word

M

Michaelg1205

I have an intranet that does not use a server. We have a hyperlink to
open a word document that opens just fine except it does not start the
VBA code. I can click on the word document and it opens with the
userform but opening the same file with a link from a web page will not
start the file with the required user form. Without the userform the
document is useless.
Anybody know what the problem is?

Michael
 
M

Michaelg1205

So what is the work-around? Surely I am not the first with the problem
or the need to do this.

Michael
 
J

Jonathan West

Michaelg1205 said:
So what is the work-around? Surely I am not the first with the problem
or the need to do this.

As far as I am aware, the only workaround is not to open the file through
the browser. All I can suggest is that you zip the file, make the link to a
zip file while the user can then download and unzip in order to open the
Word document locally.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
M

Michaelg1205

Here is what I have so far, I changed my settings on a ".DOC" file type
to open within the browser. It is under advanced settings. I am
running Windows XP Pro. Now when I click on the link it does open the
Word document and execute the VBA code. I get my userform and all
seems to be well. That is, until my VBA code tries to save the
document into another document so the stored documents will not have
all the VBA code in them. This works fine within Word or when clicking
on the file in Windows Explorer. However, when opened from a browser
it hits the code that tells Word to create a new document and it bombs.
The error message says it can't do that because the document is in
another application.

I am closer but still not there.

Michael
 
J

Jezebel

The point at issue is a very basic matter of security: if VBA code could be
run automatically from a document opened by the browser, it would *never* be
safe to open a document from the Internet.
 
M

Michaelg1205

I am not arguing that doing what I want to do on the Internet would not
be wise but there is no Internet access to my webpages. We are using
web pages on a closed network for document management. I can replace
dozens of form masters with one template using VBA to write the
variations into a document at point of use. The nature of the use will
require dozens of links going back to this same file. It makes more
sense to have dozens of links than dozens of files.

My work-around is to let the file load dead, and then have the user
start the VBA code with an Alt-R. I think it stupid that a document
has an Open event that will not work when it is Opened. The document
management is too important to give up on this just because Microsoft's
stuff does not work, as usual. If I open the document in the browser
the Open event works but some essential commands will not work, like
copying the completed document into a separate file so it can be saved
without the VBA code in every file. Even though Microsoft wants us to
think it is Word the error message says the document can't copied into
another application.

It shouldn't be this difficult.
 
J

Jezebel

I'm not challenging your intention; just trying to explain why it won't
work. Your network may well be an isolated intranet, but neither Word nor
the Browser knows that. If what you're attempting were possible, then
virus-writers would do it too.
 
M

Michaelg1205

I got your point, however, I still need to manage company documents.
How is the rest of the word doing this if not with a browser and
without buying a bunch of expensive software?
 
M

Michaelg1205

If you think that is strange. Try this:

When in windows explorer and you click on the word document to open it,
the document (.doc) is loaded as a template and what you have in front
of you is a blank document. The Macro that is set to run on "open"
does not load and run. However, if you click on the word document,
before opening, with the right mouse and chose the "open" item on the
menu it opens in your document with the macros and executes the load on
"open" VBA code.

Where is the logic here?

Michael
 

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