Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-23-2011, 06:24 PM
jerem jerem is offline VBA to Assign Aliases Windows XP VBA to Assign Aliases Office 2003
Novice
VBA to Assign Aliases
 
Join Date: Mar 2010
Posts: 6
jerem is on a distinguished road
Default VBA to Assign Aliases

I've tried to record a macro that will assign aliases to certain styles. It doesn't work. The reason I want to do this is every time something goes wrong with my computer, it is blamed on my Normal.dot and my normal gets wiped out and reinitialized by my office OST's (office support techs), which then of course wipes out all my aliases and then I have to go in and put them all back. Any way to do this? Thanks for your help.
Reply With Quote
  #2  
Old 08-24-2011, 12:23 AM
macropod's Avatar
macropod macropod is offline VBA to Assign Aliases Windows 7 64bit VBA to Assign Aliases Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi jerem,

Have you considered making a backup of your Normal.dot? That would require less effort than creating a macro (which, presumably you'd store in Normal.dot anyway - and risk its deletion). Otherwise, you'll need to provide something more descriptive than 'It doesn't work' - like a copy of your code, details of any error messages and the code lines affected, etc.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 08-24-2011, 02:17 PM
jerem jerem is offline VBA to Assign Aliases Windows XP VBA to Assign Aliases Office 2003
Novice
VBA to Assign Aliases
 
Join Date: Mar 2010
Posts: 6
jerem is on a distinguished road
Default

As mentioned previously, the reason backing up my Normal.dot won't work is when I call my company IT Help Desk when having problems and they send an OST guy over to investigate, they invariably say that my Normal.dot is corrupt and that is why I'm having problems with this, that and the other. So what they tend to do is kill my Normal.dot and open up Word and allow it to rebuild (or initialize a new Normal.dot). If I kill the new initialized Normal.dot and put my backed-up Normal.dot back and then experience those problems again and have to call IT again, they're going to come up with the same solution, which is again to kill my Normal.dot and reinitialize. That is why all of my macros that I daily use are in an Add-In Template.

The thing is there are company styles that we use. Some have been given aliases and some others have not. I have assigned aliases to those others (that don't have an aliases assigned) that I frequently use, but they always get removed when reinitializing. So I thought maybe if I have a macro that will assign those aliases in one shot rather than me having to go in there and do that all over again, however this is one macro that won't generate using "Record a Macro". Here's what it generates, which doesn't do anything (that's what I meant by it doesn't work - this does nothing when you run it).

Sub Macro1()
'
' Macro1 Macro
'
With ActiveDocument.Styles("_1.0sp Centered")
.AutomaticallyUpdate = False
.BaseStyle = "Normal"
.NextParagraphStyle = "_1.0sp Centered"
End With
With ActiveDocument.Styles("_1.0sp Centered (no space after)")
.AutomaticallyUpdate = False
.BaseStyle = "Normal"
.NextParagraphStyle = "_1.0sp Centered (no space after)"
End With
End Sub

Another thought is this: should I assign those aliases in my Add-In Template, which contains the company styles? Maybe that will solve this problem???? Thanks for your help.
Reply With Quote
  #4  
Old 12-08-2011, 07:11 PM
macropod's Avatar
macropod macropod is offline VBA to Assign Aliases Windows 7 64bit VBA to Assign Aliases Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, but what aliases are the code supposed to apply? Simply posting code you've recorded without saying what it's meant to do isn't much help.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to Assign Aliases Assign functions to F1, etc. ibclare Office 4 06-02-2011 03:22 PM
Equally allocate/assign across resouces chconnors Project 1 06-01-2011 03:27 AM
Can you assign a number to a slide and call it up? satchmo PowerPoint 1 07-26-2010 06:27 AM
Can't Assign Shortcut Keys Vicki F. Word 0 04-17-2010 03:03 PM
Assign name to a group in word document pankaj_saha Word 0 11-12-2009 10:59 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:57 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft