?
Solved

Enable Word Macros

Posted on 2005-03-15
15
Medium Priority
?
251 Views
Last Modified: 2008-01-16
I just have a simple question, I need to double check this issue before I make it a closed case.  But here is the situation, we have a group of word templates that need to be added to our intranet for employee's to access, The templates have macros in them and they need to run when the template opens.  If I place this template on my asp page and try to open it from there, the macro is disabled and won't run.  Is there any code I can add in order to force the macro to run properly.
0
Comment
Question by:Justin Imes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
15 Comments
 
LVL 20

Expert Comment

by:dsacker
ID: 13545414
A few things you can do that may not be directly Word-related, but may help:

1. Add your website to your list of trusted sites.
2. If your website is on the inTRAnet, lower the security level.
3. If you have in-house digital signatures, set up a certificate for your app (it's really not hard to do ... start with office/selfcert.exe).

Hope this helps.
0
 
LVL 9

Author Comment

by:Justin Imes
ID: 13545530
I tried what you suggested, still not working, I don't think its a security issue, I think I need to force ASP to run the macro, I have all my security level's set to low (just for testing)
0
 
LVL 20

Expert Comment

by:dsacker
ID: 13546602
If your macro is running automatically when you open your Word document, then you've already coded the open event. If you've been having to invoke the macro yourself, then you probably need to code for the open event.

Do you have something like the following in your ThisDocument VBA Editor?

Option Explicit
Private Sub Document_Open()
    Call SomeRoutine
End Sub

Also, on your Word document itself, do you have Tools, Macro, Security, Trusted Sources checkboxes turned on for both installed add-ins/templates AND access to Visual Basic Project?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Author Comment

by:Justin Imes
ID: 13546737
Hmm okay i have to try that code you provided me.

The macro will open and run perfectly in the web folder, but when I create a link to it and click open, the macro tries to run and open, sometimes, only sometimes though i will get the "disable/enable/more info" dialogue box, if i click enable.... my template will display but minus the information the macro was suppose to input.  Also when i click enable it will open up another word window but it will be blank, so i think what is happening is that when you click enable macro, it brings up a new window trying to run the macro, but for some reason the macro does not run.  does that make sense?
0
 
LVL 20

Accepted Solution

by:
dsacker earned 200 total points
ID: 13547484
Yes I think I do. You're opening the Word documents in Internet Explorer, not in MS Word itself. In essence, to achieve what you're wanting, you'd have to do the equivalent of having your end user download the document and open it locally, hence in his instance of MS Word.

Does that make sense? :)

I really think your best options will be to either:

1.  Allow them to RIGHT-CLICK on your templates link, and have them "Save As" to their local machine.

Or.

2.  Have the templates on the LAN somewhere as read-only, bypass the inTRAnet altogether, and have them open them via mapping a drive letter to that folder.
0
 
LVL 9

Author Comment

by:Justin Imes
ID: 13547569
actually those were my two "outs" if you guys couldn't help me, I just thought i was missing something.
so you think there is no way to make this happen via our intranet browser.

But thats exactly the two options I told them they had if EE couldn't give me a hand. :)
0
 
LVL 20

Expert Comment

by:dsacker
ID: 13547919
You could start an instance of MS Word via a VBSCRIPT, but you will probably still need a LAN drive mapped to everyone, because the VBSCRIPT will run as if locally (actually, no "as if" about it ... it will run purely local).

Here's an example of its simplest form. Try it. :)

<html>
<head><title>Open Word Document</title></head>
<body>
<script language=vbscript>
Sub Open_Word(strFile)
    Dim objWord

    Set objWord = CreateObject("Word.Application")
    objWord.Visible = True
    objWord.Documents.Open strFile
    Set objWord = Nothing
End Sub
</script>
<p>Enter the Word document and press the command button to open it.</p>
<input type=file name=worddoc size=40>
<input type=button value="Open Document" name=openword onclick="Open_Word(worddoc.value)">
</body>
</html>
0
 
LVL 9

Author Comment

by:Justin Imes
ID: 13548388
actually, thats didn't work either, same result.  The macros didn't run.

But thats a very nice and simple form.

I think my only option is to let our users know they can not just Open the document, they need to either save as or access through the network (mapped drive)
0
 
LVL 20

Expert Comment

by:dsacker
ID: 13548554
You could add a line after you open the objWord, such as:

    objWord.Run MyMacro, MyParameter

After that, I'm about at the end of my suggestions. :)
0
 
LVL 9

Author Comment

by:Justin Imes
ID: 13555288
Hmm that also doesn't seem to be working, I think I am just going to purpose the two ideas we posted up earlier.
0
 
LVL 9

Author Comment

by:Justin Imes
ID: 13568103
Thanks for your help, the points are yours for backing up my thoughts.
0
 
LVL 20

Expert Comment

by:dsacker
ID: 13568349
You're welcome.

I'm a little surprised that for the extent of my help, you'd only grade this as a "B", especially considering you only spent 50 points on the question.

You certainly got a 2nd-mile contribution on my part. Your disappointment in a solution that is not exactly what you wanted should not penalize someone's effort in researching the best possible solutions that were available.
0
 
LVL 9

Author Comment

by:Justin Imes
ID: 13568551
I apologize, you certainly did help me, is there a way to change the grade i have given? I was in a hurry and didn't put much thought into it, if it concerns you, I will change it, you do deserve it for the effort.
0
 
LVL 9

Author Comment

by:Justin Imes
ID: 13569213
Thank You.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question