Word Macro
weenadelic
Status: New User - Welcome
Joined: 26 Jan 2006
Posts: 3
Reply Quote
This may be a silly question, but I have used the macro feature to set the "Save As" path of a .dot file in Word.

Is there any way to keep the macro from transferring to the saved .doc file?

Any help would be greatly appreciated!
Back to top
erikZ
Status: Contributor
Joined: 30 May 2004
Posts: 148
Reply Quote
weenadelic, aside from having a great username, that's a good question. No reference to ween by any chance?

I can't find anyway to get rid of the macro without deleting it in the first place, which I guess is not what you want.

Maybe somebody else knows how to do that.

One guess would be to run a macro to remove the macro itself, but then the default save path would be lost.

If I get what you are asking right, you have a document template that includes in it a macro to set the save as path. Correct?

The first question is why not just change the default save to location in the template document in the first place, therefore bypassing the whole question?

In other words, create the template .dot file.

In that file, change:

'tools -> options -> file locations [documents] to the path you want it to default to in the first place, and dump the macro.

That's probably not what you want, but it's the first thing that pops into my head.

I couldn't see any easy way to remove a macro on 'save' however. Obviously, if you did create a macro to remove the first macro, it would be gone after the first save operation, which is probably not what you want, although that might work, since word tends to remember the last opened location for any one session. But I doubt it would really work the way you want.
Back to top
default path
weenadelic
Status: New User - Welcome
Joined: 26 Jan 2006
Posts: 3
Reply Quote
Wow!

Gotta love quick replies... And yes the name is a reference to the "GREATEST BAND OF ALL TIME" Ween.

My actual situation is that I have about 25 users who will be using one of three Word templates to create docs from... These docs then need to be stored in a folder on a server so the rest of the 25 have access to them.

The biggest problems with the macro is these documents may be emailed out to someone. If that person then decides to edit the document at all, or for any reason uses "Save As" they get the macros not enabled window (I assume because it can't find the path to the folder on the server).

The problem with setting the default path, is that it does not seem to be document specific, and defaults the saving of all docs to that location. Which with the user group I am working with will mean sorting out all the files "accidentally" saved to the server at the end of the day.

I know there has to be a better way to do this than just mapping drives for everyone because users are located city wide.

Again, Thanks for such a quick reply!
Back to top
erikZ
Status: Contributor
Joined: 30 May 2004
Posts: 148
Reply Quote
There's a couple of points. The macros not enabled message other users get is I believe a windows office security setting. They need to change their macro security to 'medium' to run the macro. Don't quote me on this, but I believe Office got slammed with so many macro attacks that if you aren't the owner of the document, Office will pop up this warning when you open up a foreign document.

So I don't think that's related to not finding the path, although it could be, I've seen much stranger Office bugs.

To me it doesn't sound realistic to get that type of customization. I hear what you're saying re users ending up saving their stuff all over the place to the wrong location, I can see that.

It sort of sounds to me that you're pushing Word's limits here. There's some stuff you could do, if the users are on a domain, you could test for the presence of the domain folders in the macro itself, then only run the macro if the folder is present. I don't know vba well enough to know if that's within the allowed functionality, my guess is it is, since you're just testing for the network attached folder.

I use a similar test for network logons, if user is admin, mount folder x or y, if standard users, m and n. That's a bat file though. My guess though, without seeing the actual scripting, is that if you can assign a folder, you can test for the existence of that folder. That's the easiest way I can think of to support both local and remote users.

As for setting remote user macro permissions, not a lot you can do in that area, the alert is going to come when the macro tries to load, before it runs, so you can't test meaningfully I think. You'd have to test that though to see. Easy test would be check for network storage folder, if not there, don't run the macro, then see if users report not being able to run the macro without a popup. If no error, the error is caused by absence of the folder, if error, it's a security setting.

Or run it as a web based app
This sounds to me like it should be a web based app though, running on a web server, I setup IIS to do that, MSIE in its infinite insecurity actually allowed IIS to run a word document as a webpage, horrible security hole it it's live on the web, but it works fine. Then the user only sees the single document always, it saves to the server always. But if you aren't very very up on securing IIS, which is almost impossible technically, hackers are going to be at your door within a few hours. That's how long it took hackers last time I ran IIS on the web, I shut it down.

Or if it's a form or something, should be run by a database. Hard to say without details though. I find that the microsoft solution is often not a good one.

<completely offtopic, but who cares>
As for ween, I wish I'd seen them in their prime, but since I saw the butthole surfers in their prime, I'm fairly content. They were the best live band of their time. By a huge margin, no one was even remotely close, except maybe sonic youth. Then of course if you go back to the '60s, mid 60's, Jefferson Airplane, the dead, 13th floor elevators if you liked the real underground stuff - for the brief period they managed to keep their sanity intact, of course, all of about 3 years. But the ween stuff I've heard is really good too. Wish I'd seen them live though, that's the acid test.
Back to top
Thanks
weenadelic
Status: New User - Welcome
Joined: 26 Jan 2006
Posts: 3
Reply Quote
Again,

Thank you so much for all the help Erik... I myself have been pushing for the "web based" theory, some sort of small content management system that would allow for the use of forms to collect data, and then build html pages dynamically from the database. Then, if my users really needed to, they could just copy and paste the information from said html page to a Word doc for emailing. Unfortunately, I work for my city government and getting them to do anything in a web environment has been a nightmare.

my alternative, and what I am going to do I guess is map the drive... At least then they will have it as an option in their save location drop down.

The main problem is I get "I don't want to type all that stuff"... and this to rsponse is to "type \\servername\folder" hehe

Sometimes lifes a ........ Or at least Microsoft is.

<off topic, yet very important ;-)>
I totally agree, I once saw Sonic youth and the Butthole Surfers in the same weekend... Followed the next weekend by Ministry. Oh those were the days. I miss the "It's not a rock show until someone catches on fire" attitude.

If you do though get a chance to go see Ween DO IT!

Unlike many bands that I have loved over the years, I have seen them 12 times and every show is better than the last.

In fact, I just saw them this past November in Omaha 4 hours of rock with no opener, ya can't beat that!

Thanks again man, and now that I'm a member here I'm sure we'll talk more.
Back to top
erikZ
Status: Contributor
Joined: 30 May 2004
Posts: 148
Reply Quote
This is the script I use to create the network drive automatically on login.

On the server, I have this script, which is called logins.bat <replace <admin user name> with the actual admin user name>:

If the admin user sees the same as the normal users everything from If... to the end can be deleted, makes it even simpler.

:: Code ::
net use q: \\fileserver\section1 /persistent:no
net use r: \\fileserver\section2 /persistent:no
If %USERNAME%==<admin user name>
If exist "\\fileserver\admin-folder" net use z: \\fileserver\admin-folder /persistent:no
@echo on
@echo ======================================
@echo drives mounted
@echo ======================================
if %USERNAME%==<admin user name> pause

Every machine on the network calls this script, located on the file server, on logon using this simple short script:

:: Code ::
call \\fileserver\section1\scripts\logins.bat

This is placed in each machine's login script folder, which is:
WINNT\system32\repl\import\scripts\log-local.bat
The path to log-local.bat is not optional, it must be in that folder. If the folders don't exist you have to create them.

I think each machine has to be given that path manually unfortunately, but you only have to do it once, then the network drive is always created when they logon. And since no actual data except calling the file server script is contained locally, all you need to do to change the network drive creation is update the one script on the server and have people logon.

That solves the typing in of the path issue, it will just be there for them, if you can do that.

I know what you mean about setting up web stuff and fear, it's hard to get city types to take any initiative, they're afraid of getting in trouble, and they're afraid of the web. Drag is you could get any old machine lying around, pop debian stable on it, install apache, php, and dbs, then install say drupal. That takes a few hours. Then the site would be up and running in the time it took to setup drupal to do what you wanted. A few days probably. Sometimes people make this stuff way too complicated, too many decision makers etc.

<welcome to the forums by the way...>
Back to top
Display posts from previous:   

All times are GMT - 8 Hours