We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Setting of underlying properties in VBA

Medium Priority
455 Views
Last Modified: 2013-11-10
How do I set underlying properties of my newly created style in word VBA???
underlying-properties.bmp
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2008

Commented:
Try using the BaseStyle property after you create the new style to the document.   For example:
With ActiveDocument
    .Styles.Add Name:="Xref", Type:=wdStyleTypeCharacter
    .Styles("XRef").BaseStyle = wdStyleCommentReference
    'or use
    '.Styles("XRef").BaseStyle = "Comment Reference"
End With

Open in new window

Author

Commented:
Hi irudyk, by using wdStyleCommentReference, I am creating baseStyle as comment reference. What I want is to set Style based on "underlying properties".
CERTIFIED EXPERT
Top Expert 2008
Commented:
Okay then set the BaseStyle = ""
See below:

With ActiveDocument
    .Styles.Add Name:="Xref", Type:=wdStyleTypeCharacter
    .Styles("XRef").BaseStyle = ""
End With

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Top Expert 2008

Commented:
Just curious if you had any luck with the above code?

Author

Commented:
I was away for a few days, It worked, thankx !
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.