Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Hi all, any help would be greatly appreciated!

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,852
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Hi all, any help would be greatly appreciated!
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Hi all, any help would be greatly appreciated! - 6/11/2003 12:28:12 AM   
  opr8or

 

Posts: 1
Score: 0
Joined: 6/11/2003
From:
Status: offline
Hi all, any help would be greatly appreciated!

I am trying to develop a script that will edit every user account's
Normal.dot file regardless of which user is currently logged in.

In each Normal.dot I am trying to delete an incorrect AutoTextEntry.

At the moment my script will delete the entry for the current user
only, even if you point it to another users Normal.dot

The code might help to explain better:

'***********************************************************
' This script resets an AutoText Entry within Word 2000
'
' Script will replace incorrect entries such as:
' "incorrect company name" in normal.dot
' for a user other than the one currently logged in.
'
'***********************************************************

on error resume next

Set wdapp = CreateObject("Word.Application")

Set wddoc = wdapp.Documents.Open("C:\Documents and
Settings\USER1\Application Data\Microsoft\Templates\Normal.dot")

' Or maybe one of the following lines:
'Set wddoc = wdapp.Documents.Add
'Set wddoc = wdapp.Documents.Add("C:\Documents and
Settings\User1\Application Data\Microsoft\Templates\Normal.dot")


wdapp.NormalTemplate.AutoTextEntries("incorrect company name").Delete
' The above line changes the AutoTextEntries in the CURRENT users
' Normal.dot, not the USER1 specified in the open command.
' I can't find any function to delete it for USER1's normal.dot


wddoc.Styles("Signature Company").Delete

wdapp.NormalTemplate.Save

wddoc.SaveAs "Normal.dot", , , , , , , , , , False

wddoc.Close False

wdapp.Quit

'*************************************************************************

thanx for your time!
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Hi all, any help would be greatly appreciated! Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts