• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 439
  • Last Modified:

Setting of underlying properties in VBA

How do I set underlying properties of my newly created style in word VBA???
underlying-properties.bmp
0
KenTan85
Asked:
KenTan85
  • 3
  • 2
1 Solution
 
irudykCommented:
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

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

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

Open in new window

0
 
irudykCommented:
Just curious if you had any luck with the above code?
0
 
KenTan85Author Commented:
I was away for a few days, It worked, thankx !
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now