Here is a simple way to disable the Cut & Copy in the Popup menu
Sub Disable_Buttons()
Dim oC1 As CommandBar
Set oC1 = Application.CommandBars("CELL")
oC1.Controls("Cu&t").Enabled = False
oC1.Controls("&Copy").Enabled = False
End Sub
Other menu items can also be handled similarly
To disable the Insert & Delete in the Popup menu
oC1.Controls("&Insert...").Enabled = False
oC1.Controls("&Delete...").Enabled = False
Showing posts with label Document Styles using Word VBA. Show all posts
Showing posts with label Document Styles using Word VBA. Show all posts
Sunday, August 12, 2007
Sunday, July 08, 2007
Paragraph & Character Styles in Word Document (Word VBA)
Export Character Styles from Word Document / Export Paragraph Styles from Word Document
Here is the simple macro for extracting character & paragraph styles from a Word document. This exports the styles to a new word document
Here is the simple macro for extracting character & paragraph styles from a Word document. This exports the styles to a new word document
Sub Export_Styles_In_Document()
Dim oSource As Document
Dim oRep As Document
Dim oPara As Paragraph
Set oRep = Documents.Add
Set oSource = ActiveDocument
For I = 1 To oSource.Styles.Count
If oSource.Styles(I).Type = wdStyleTypeParagraph Then
SType = "Para"
oRep.Bookmarks("\EndOfDoc").Select
Set oPara = oRep.Paragraphs.Add
Set oPara = oRep.Paragraphs.Add
oPara.Range.Text = SType & ": " & oSource.Styles(I).NameLocal
Else
SType = "Char"
End If
Next I
For I = 1 To oSource.Styles.Count
If oSource.Styles(I).Type = wdStyleTypeParagraph Then
SType = "Para"
Else
SType = "Char"
oRep.Bookmarks("\EndOfDoc").Select
Set oPara = oRep.Paragraphs.Add
Set oPara = oRep.Paragraphs.Add
oPara.Range.Text = SType & ": " & oSource.Styles(I).NameLocal
End If
Next I
oRep.Activate
End Sub
Subscribe to:
Posts (Atom)
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.