Click here to Skip to main content
15,886,001 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written code for Application level MS Word Addin according to my own requirement for built in headings now i want to assign shortcut key to them. Following is the code. While using word this can be achieved by clicking on a style i.e Heading 1-> modify->shortcut key

<br />
<br />
With oDoc.Styles(word.WdBuiltinStyle.wdStyleHeading1)<br />
            .Font.Bold = False<br />
            .Font.Size = 12<br />
            .Font.Name = "Arial"<br />
            .Font.Spacing = 16<br />
            .NameLocal = "Heading1"<br />
            .BaseStyle = "Normal"<br />
            .ParagraphFormat.SpaceBefore = 6<br />
            .ParagraphFormat.OutlineLevel = 1<br />
            With .ParagraphFormat.TabStops<br />
                .Add(Position:=oWord.CentimetersToPoints(2), Alignment:=word.WdAlignmentTabAlignment.wdCenter)<br />
            End With<br />
            .ParagraphFormat.KeepWithNext = True<br />
            .LinkToListTemplate(oTemplate1)<br />
        End With<br />
<br />


Please guide how assign shortcut keys using code.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900