Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
a.e.neuman a.e.neuman is offline
external usenet poster
 
Posts: 1
Default Make these macros available at all times even if normal.dot is rep

Hello experts,

I have two macros that I want to be available at all times (and secondly for
all users - or easlily portable to users). These macros instruct Word to
show the document's FULL PATH in Word's title bar - VERY useful indeed (I'll
show the macros below). The macros run automatically when a document is
opened and/or saved.

Several times now Normal.dot has become corrupt and had to be replaced - and
we lost these macros and had to re-create them and they seem to go into
Normal.dot.

How can we make these macros available at all times (and secondly for all
users) and have them reside outside of Normal.dot?

Here are the macros;

------------------------------------------------
Sub AutoOpen()
'
' Macro added
'
ActiveWindow.Caption = ActiveDocument.FullName

End Sub

Sub FileSaveAs()
'
' Macro added
'

Dim pRange As Word.Range
Dim oFld As Field
On Error GoTo Handler
Retry:
With Dialogs(wdDialogFileSaveAs)
If .Show = 0 Then Exit Sub
End With
System.Cursor = wdCursorNormal
ActiveWindow.Caption = ActiveDocument.FullName
For Each pRange In ActiveDocument.StoryRanges
Do
For Each oFld In pRange.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
End If
Next oFld
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
ActiveDocument.Save
Exit Sub
Handler:
If Err.Number = 5155 Or Err.Number = 5153 Then
MsgBox Err.Decription, vbOKOnly
Resume Retry
End If

End Sub
----------------------------------------------------------

Thank you in advance for help/tricks/pointers

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Pranav Vaidya[_2_] Pranav Vaidya[_2_] is offline
external usenet poster
 
Posts: 59
Default Make these macros available at all times even if normal.dot is rep

please see my answer to your question under Programming
--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"a.e.neuman" wrote:

Hello experts,

I have two macros that I want to be available at all times (and secondly for
all users - or easlily portable to users). These macros instruct Word to
show the document's FULL PATH in Word's title bar - VERY useful indeed (I'll
show the macros below). The macros run automatically when a document is
opened and/or saved.

Several times now Normal.dot has become corrupt and had to be replaced - and
we lost these macros and had to re-create them and they seem to go into
Normal.dot.

How can we make these macros available at all times (and secondly for all
users) and have them reside outside of Normal.dot?

Here are the macros;

------------------------------------------------
Sub AutoOpen()
'
' Macro added
'
ActiveWindow.Caption = ActiveDocument.FullName

End Sub

Sub FileSaveAs()
'
' Macro added
'

Dim pRange As Word.Range
Dim oFld As Field
On Error GoTo Handler
Retry:
With Dialogs(wdDialogFileSaveAs)
If .Show = 0 Then Exit Sub
End With
System.Cursor = wdCursorNormal
ActiveWindow.Caption = ActiveDocument.FullName
For Each pRange In ActiveDocument.StoryRanges
Do
For Each oFld In pRange.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
End If
Next oFld
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
ActiveDocument.Save
Exit Sub
Handler:
If Err.Number = 5155 Or Err.Number = 5153 Then
MsgBox Err.Decription, vbOKOnly
Resume Retry
End If

End Sub
----------------------------------------------------------

Thank you in advance for help/tricks/pointers

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Make these macros available at all times even if normal.dot is rep

Store the macros in an add-in in your Startup folder.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"a.e.neuman" wrote in message
news
Hello experts,

I have two macros that I want to be available at all times (and secondly

for
all users - or easlily portable to users). These macros instruct Word to
show the document's FULL PATH in Word's title bar - VERY useful indeed

(I'll
show the macros below). The macros run automatically when a document is
opened and/or saved.

Several times now Normal.dot has become corrupt and had to be replaced -

and
we lost these macros and had to re-create them and they seem to go into
Normal.dot.

How can we make these macros available at all times (and secondly for all
users) and have them reside outside of Normal.dot?

Here are the macros;

------------------------------------------------
Sub AutoOpen()
'
' Macro added
'
ActiveWindow.Caption = ActiveDocument.FullName

End Sub

Sub FileSaveAs()
'
' Macro added
'

Dim pRange As Word.Range
Dim oFld As Field
On Error GoTo Handler
Retry:
With Dialogs(wdDialogFileSaveAs)
If .Show = 0 Then Exit Sub
End With
System.Cursor = wdCursorNormal
ActiveWindow.Caption = ActiveDocument.FullName
For Each pRange In ActiveDocument.StoryRanges
Do
For Each oFld In pRange.Fields
If oFld.Type = wdFieldFileName Then
oFld.Update
End If
Next oFld
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
ActiveDocument.Save
Exit Sub
Handler:
If Err.Number = 5155 Or Err.Number = 5153 Then
MsgBox Err.Decription, vbOKOnly
Resume Retry
End If

End Sub
----------------------------------------------------------

Thank you in advance for help/tricks/pointers


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy macros to a new normal.dot? M Skabialka Microsoft Word Help 5 June 5th 07 06:23 PM
Normal.dot with macros Tony in Utah Microsoft Word Help 11 October 20th 05 08:20 PM
How do I make Arial rather than Times Roman the font? Antonyp32 New Users 9 August 26th 05 05:11 PM
how do you make a macro execute x number of times? ShelleyC Microsoft Word Help 1 March 14th 05 03:05 PM
Macros in Normal.dot BenJ Microsoft Word Help 3 November 26th 04 11:08 AM


All times are GMT +1. The time now is 07:48 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"