AutoNew for Auto numbering not working for all users

From: Brenna (anonymous_at_discussions.microsoft.com)
Date: 02/27/04


Date: Fri, 27 Feb 2004 14:29:19 -0800

Have inserted an AutoNew macro for autonumbering (see
below)into a form template. The bookmark the text file is
dumping into is in an unprotected section of the
template. Both template and accompanying text file reside
on a common server. The problem? It works fine from my
computer and another computer in my office, but does not
work from other computers on the network. The employees
have read rights to the folder where the template resides
through a tab within word. When the user
selects "FileNew", the file opens and hesitates, like it
is tryping to pull it together, then they get a Visual
Basic error which reads: Method 'PrivateProfileString' of
object 'System' Failed. Where do I start looking
(location, permissions, etc.) for a solution so all can
access the autonumbering schema?
----------------------------------------

Sub AutoNew()
'
' AutoNew Macro
' Macro created 9/17/2003 by XXXXXX
'

ReqNo = System.PrivateProfileString("\\NTServer\
Settings.Txt", "MacroSettings", "ReqNo")
If ReqNo = "" Then
    ReqNo = 0
Else
    ReqNo = ReqNo + 1
End If

System.PrivateProfileString
("\\NTServer\Settings.Txt", "MacroSettings", "ReqNo") =
ReqNo

ActiveDocument.Bookmarks("ReqNo").Range.InsertBefore Format
(ReqNo, "00000#")
ActiveDocument.SaveAs FileName:="ReqNo" & Format
(ReqNo, "00000#")

End Sub



Relevant Pages

  • Re: Follow-Up ... Creating Sequential Part Deux
    ... access problem, if the second, then we are facing a network rights problem. ... > template resides on the company network. ... > I have inserted an AutoNew macro for autonumbering (see ... > If ReqNo = "" Then ...
    (microsoft.public.word.vba.general)
  • Re: Creating sequentially numbered documents
    ... They will need Read/Write access for the routine to work. ... > template resides on the company network. ... > Have inserted an AutoNew macro for autonumbering (see ... > If ReqNo = "" Then ...
    (microsoft.public.word.vba.general)
  • template with auto fields
    ... put DocProperty Fields in your template header or footer. ... The AutoNew Macro code is: ...
    (microsoft.public.word.pagelayout)
  • Re: Can I create sequentially numbered documents on a server?
    ... "Jay Freedman" wrote: ... with Sub AutoNew() at the beginning and with End Sub at the ... This will cause the Purchase Order template -- and any other templates you ... You need to copy the AutoNew macro code from the article and put it ...
    (microsoft.public.word.docmanagement)
  • Re: User form and macro to run on open
    ... of a stretch for a vba beginner. ... A simpler solution is to use an ask field and an includetext field in the ... You will need an autonew macro in the template to fire the ASK field when a ... I did the Autonew macro bit and it works perfectly. ...
    (microsoft.public.word.vba.general)