Menu

 

Sunday, July 18, 2010

Reference-Collection:- (B) :- Bookmarks Collection

VBA Code :-

If ActiveDocument.Bookmarks.Exists("temp") = True Then
ActiveDocument.Bookmarks("temp").Select
End If

C# Code :-

public void BookMarkExists()
{
bool isBookMarkPresent = ThisApplication.ActiveDocument.Bookmarks.Exists("Temp");

if (isBookMarkPresent)
{
object Name = "temp";
ThisApplication.ActiveDocument.Bookmarks.get_Item(ref Name).Select();
}
}

VBA Code :-

ActiveDocument.Bookmarks.Add Name:="temp", Range:=Selection.Range

C# Code :-

public void BookmarksAdd()
{
string Name = "temp";
Word.Range wordrange = ThisApplication.Selection.Range;
object wr = wordrange;

ThisApplication.ActiveDocument.Bookmarks.Add(Name, ref wr);

}

VBA Code :-

ActiveDocument.Paragraphs(1).Borders.Enable = True

C# Code :-

public void BordersEnable()
{
ThisApplication.ActiveDocument.Paragraphs[1].Borders.Enable = 1;
}

VBA Code :-

With ActiveDocument.Paragraphs(1).Borders(wdBorderBottom)
.LineStyle = wdLineStyleDouble
.LineWidth = wdLineWidth025pt
End With

C# Code :-

public void ParaBorder()
{
ThisApplication.ActiveDocument.Paragraphs[1].Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleDouble;
ThisApplication.ActiveDocument.Paragraphs[1].Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineWidth = Microsoft.Office.Interop.Word.WdLineWidth.wdLineWidth025pt;
}

VBA Code :-

With Selection.Characters(1)
.Font.Size = 36
.Borders.Enable = True
End With

C# Code :-

public void Characterselection()
{
ThisApplication.Selection.Characters[1].Font.Size = 36;
ThisApplication.Selection.Characters[1].Borders.Enable = 1;
}

VBA Code :-

For Each aBorder In ActiveDocument.Sections(1).Borders
With aBorder
.ArtStyle = wdArtSeattle
.ArtWidth = 20
End With
Next aBorder

C# Code :-

public void sectionBorder()
{
foreach (Word.Border aborder in ThisApplication.ActiveDocument.Sections[1].Borders)
{
aborder.ArtStyle = Microsoft.Office.Interop.Word.WdPageBorderArt.wdArtSeattle;
aborder.ArtWidth = 20;
}
}

VBA Code :-

Dim objBreaks As Breaks

Set objBreaks = ActiveDocument.ActiveWindow _
.Panes(1).Pages(1).Breaks

C# Code :-

Dim objBreaks As Breaks

Set objBreaks = ActiveDocument.ActiveWindow _
.Panes(1).Pages(1).Breaks

No comments:

Post a Comment