School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,368 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,451 people online right now. Registration is fast and FREE... Join Now!




VBA Macro for word

 

VBA Macro for word

Damage

24 Jun, 2009 - 12:57 PM
Post #1

D.I.C Addict
Group Icon

Joined: 5 Jun, 2008
Posts: 975



Thanked: 14 times
Dream Kudos: 75
My Contributions
Hi

I have this vba snippet that just pops up a message box when the document is opened in read-only mode(we have a document management system that does tell users in the tool bar, that they are in read-only, but apparently thats not enough)

CODE

Private Sub Document_Open()

  
    
       If ActiveDocument.ReadOnly = True Then
        
    MsgBox "This document has been opened in Read-Only Mode", vbOKOnly, "Warning"

      
      
    End If

End Sub



the code works but how can i distribute it across the network. I know i can merge it with the normal.dot in the microsoft startup folder but some people have customized .dots and i don't want to overwrite them. I have tried renaming the .bac to a .dot but i keep getting a message telling me that it's not a valid template. Any ideas?

This post has been edited by Damage: 24 Jun, 2009 - 01:04 PM

User is offlineProfile CardPM
+Quote Post


MajorWalrus

RE: VBA Macro For Word

24 Jun, 2009 - 01:14 PM
Post #2

D.I.C Head
**

Joined: 22 Apr, 2009
Posts: 97



Thanked: 9 times
My Contributions
I believe, though I'm no expert, that Word allows multiple templates to be open. So, if you push your snippet out in Normal.dot, users should still be able to use a custom template on top of that.

Does the DMS you're using interface with Word through Normal.dot? If it does, put your snippet there and you should be golden.
User is offlineProfile CardPM
+Quote Post

Damage

RE: VBA Macro For Word

24 Jun, 2009 - 02:47 PM
Post #3

D.I.C Addict
Group Icon

Joined: 5 Jun, 2008
Posts: 975



Thanked: 14 times
Dream Kudos: 75
My Contributions
sorry i meant that they had customised their normal.dot files

so yeah i could create a new one that includes the code above and release it like that but that would overwrite their current normal.dot which would piss a lot of people off tongue.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 08:54PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month