VBA Code :-
Sub AddCanvasShapes()
Dim shpCanvas As Shape
Dim shpCanvasShapes As CanvasShapes
Dim shpCnvItem As Shape
'Adds a new canvas to the document
Set shpCanvas = ActiveDocument.Shapes _
.AddCanvas(Left:=100, Top:=75, _
Width:=50, Height:=75)
Set shpCanvasShapes = shpCanvas.CanvasItems
'Adds shapes to the CanvasShapes collection
With shpCanvasShapes
.AddShape Type:=msoShapeRectangle, _
Left:=0, Top:=0, Width:=50, Height:=50
.AddShape Type:=msoShapeOval, _
Left:=5, Top:=5, Width:=40, Height:=40
.AddShape Type:=msoShapeIsoscelesTriangle, _
Left:=0, Top:=25, Width:=50, Height:=50
End With
End Sub
C# Code :-
public void AddCanvasShapes()
{
Word.Shape shpCanvas = null;
Word.CanvasShapes shpCanvasShapes = null;
Word.Shape shpCnvItem = null;
shpCanvas = ThisApplication.ActiveDocument.Shapes.AddCanvas(100f, 75f, 50, 75f, ref missing);
shpCanvasShapes = shpCanvas.CanvasItems;
shpCanvasShapes.AddShape(1, 0f, 0f, 50f, 50f);
shpCanvasShapes.AddShape(2, 0f, 0f, 40f, 40f);
shpCanvasShapes.AddShape(2, 0f, 25f, 50f, 50f);
}
VBA Code :-
Sub CanvasShapeThree()
With ActiveDocument.Shapes(1).CanvasItems(3)
.Line.ForeColor.RGB = RGB(50, 0, 255)
.Fill.ForeColor.RGB = RGB(50, 0, 255)
.Flip msoFlipVertical
End With
End Sub
C#
public void CanvasShapeThree()
{
object shapesid = "1";
object CanvasItem = "3";
Microsoft.Office.Interop.Word.ColorFormat ColorRGB ;
ThisApplication.ActiveDocument.Shapes.get_Item(ref shapesid).CanvasItems.get_Item(ref CanvasItem).Line.ForeColor.RGB = 1;
ThisApplication.ActiveDocument.Shapes.get_Item(ref shapesid).CanvasItems.get_Item(ref CanvasItem).Flip(Microsoft.Office.Core.MsoFlipCmd.msoFlipVertical);
}
VBA Code :-
CaptionLabels.Add Name:="Photo"
C# Code :-
public void CaptionLabel()
{
ThisApplication.CaptionLabels.Add("Photo");
}
VBA Code :-
CaptionLabels("Figure").NumberStyle = _
wdCaptionNumberStyleLowercaseLetter
C# Code :-
public void CaptionLabes()
{
object objindex = 1;
ThisApplication.CaptionLabels.Add("Photo");
ThisApplication.CaptionLabels.get_Item(ref objindex).NumberStyle = Microsoft.Office.Interop.Word.WdCaptionNumberStyle.wdCaptionNumberStyleHindiLetter1;
}
VBA Code :-
ActiveDocument.Tables(1).Rows(1).Cells.Width = 30
C# Code :-
public void TablesCell()
{
ThisApplication.ActiveDocument.Tables[1].Rows[1].Cells.Width = 30;
}
VBA Code :-
num = Selection.Rows(1).Cells.Count
C# Code :-
public void SelRows()
{
int num = 0;
num = ThisApplication.Selection.Rows[1].Cells.Count;
}
VBA Code :-
Set myTable = ActiveDocument.Tables(1)
myTable.Range.Cells.Add BeforeCell:=myTable.Cell(1, 1)
C# Code:-
public void myTable()
{
object beforecell = "1,2";
Word.Table myTable = ThisApplication.ActiveDocument.Tables[1];
myTable.Range.Cells.Add(ref beforecell);
}
VBA Code :-
Set myCell = ActiveDocument.Tables(1).Cell(Row:=1, Column:=2)
myCell.Shading.Texture = wdTexture20Percent
C# Code :-
public void MyCell()
{
int Row = 1;
int Column = 2;
Word.Table myTable = ThisApplication.ActiveDocument.Tables[1];
myTable.Cell( Row, Column);
myTable.Shading.Texture = Microsoft.Office.Interop.Word.WdTextureIndex.wdTexture20Percent;
}
VBA Code :-
Set myTable = ActiveDocument.Tables(1)
Set aColumn = myTable.Columns.Add(BeforeColumn:=myTable.Columns(1))
For Each aCell In aColumn.Cells
aCell.Range.Delete
aCell.Range.InsertAfter num + 1
num = num + 1
Next aCell
C# Code :-
public void DeeleteColumCell()
{
Word.Table myTable = ThisApplication.ActiveDocument.Tables[1];
object col = "1";
object beforeColumn = myTable.Columns.Add(ref col);
Word.Column aColumn = (Word.Column)myTable.Columns.Add(ref beforeColumn);
int num =0;
foreach (Word.Cell aCell in aColumn.Cells)
{num ++;
aCell.Range.Delete(ref missing, ref missing);
aCell.Range.InsertAfter("" + num + 1 + "");
}
}
VBA Code :-
With ActiveDocument
.Paragraphs(1).Range.InsertParagraphAfter
.Paragraphs(2).Range.InsertBefore "New Text"
End With
C# Code :-
public void Charatcertest()
{
ThisApplication.ActiveDocument.Paragraphs[1].Range.InsertAfter("test1");
ThisApplication.ActiveDocument.Paragraphs[2].Range.InsertAfter("New Text");
}
VBA Code :-
MsgBox ActiveDocument.Tables(1).Columns.Count
C# Code :-
MessageBox.Show((string)ThisApplication.ActiveDocument.Tables[1].Columns.Count);
VBA Code :-
Set myTable = ActiveDocument.Tables.Add(Range:=Selection.Range, _
NumRows:=3, NumColumns:=6)
For Each col In myTable.Columns
col.Shading.Texture = 2 + i
i = i + 1
Next col
C# Code :-
public void ActiveTablesAdd()
{
Word.Range wordRange = ThisApplication.Selection.Range;
Word.Table myTable = ThisApplication.ActiveDocument.Tables.Add(wordRange, 3, 6, ref missing, ref missing);
foreach (Word.Column col in myTable.Columns)
{
col.Shading.Texture = Microsoft.Office.Interop.Word.WdTextureIndex.wdTexture15Percent ;
}
}
VBA Code :-
If ActiveDocument.Tables.Count >= 1 Then
Set myTable = ActiveDocument.Tables(1)
myTable.Columns.Add BeforeColumn:=myTable.Columns(1)
myTable.Columns.DistributeWidth
End If
C# Code :-
public void ActiveDocumentTablesCount()
{
int tablecount = ThisApplication.ActiveDocument.Tables.Count;
if (tablecount >= 1)
{
Word.Table myTable = ThisApplication.ActiveDocument.Tables[1];
object BeforeColumn = myTable.Columns[1];
myTable.Columns.Add(ref BeforeColumn);
myTable.Columns.DistributeWidth();
}
}
VBA Code :-
ActiveDocument.Tables(1).Columns(1).Select
C# Code :-
public void ColSelect()
{
ThisApplication.ActiveDocument.Tables[1].Columns[1].Select();
}
VBA Code :-
ActiveDocument.ActiveWindow.View.SplitSpecial = wdPaneComments
ActiveDocument.Comments.ShowBy = "Don Funk"
C# Code :-
public void SplitView()
{
ThisApplication.ActiveWindow.View.SplitSpecial = Microsoft.Office.Interop.Word.WdSpecialPane.wdPaneComments;
ThisApplication.ActiveDocument.Comments.ShowBy = "Avinash Tiwari";
}
VBA Code :-
Selection.Collapse Direction:=wdCollapseEnd
ActiveDocument.Comments.Add Range:=Selection.Range, _
Text:="review this"
C# Code :-
public void Collpasetest()
{
object Director = Word.WdCollapseDirection.wdCollapseEnd;
ThisApplication.Selection.Collapse(ref Director);
ThisApplication.Selection.Text = "Review This";
}
VBA Code :-
MsgBox ActiveDocument.Comments(1).Author
C# Code :-
public void ActiveComments()
{
string strMessage = ThisApplication.ActiveDocument.Comments[1].Author;
MessageBox.Show(strMessage);
}
VBA Code :-
MsgBox Application.MailingLabel.CustomLabels.Count
C# Code :-
public void MailingLable()
{
int strMessage = ThisApplication.MailingLabel.CustomLabels.Count;
MessageBox.Show(strMessage.ToString());
}
VBA Code :-
Set ML = _
Application.MailingLabel.CustomLabels.Add(Name:="My Labels", _
DotMatrix:=False)
ML.PageSize = wdCustomLabelA4
C# Code :-
public void MailingLabel()
{
object DotMatrix = false;
string strName = "My label";
Word.MailingLabel mailLable = ThisApplication.MailingLabel;
mailLable.CustomLabels.Add(strName, ref DotMatrix);
}
VBA Code :-
If Application.MailingLabel.CustomLabels.Count >= 1 Then
MsgBox Application.MailingLabel.CustomLabels(1).Name
End If
C# Code :-
public void AppMailingLablel()
{
if (ThisApplication.MailingLabel.CustomLabels.Count >= 1)
{object indexvalue = 1;
string strCustomLabels = ThisApplication.MailingLabel.CustomLabels.get_Item(ref indexvalue).Name;
}
}
VBA Code :-
Sub AddProps()
With ThisDocument.SmartTags(1)
.Properties.Add Name:="President", Value:=True
MsgBox "The XML code is " & .XML
End With
End Sub
C# Code :-
public void AddProps()
{
object inderxId =1;
ThisDocument mydoc = new ThisDocument();
mydoc.SmartTags.get_Item(ref inderxId).Properties.Add("Avinash", "true");
}
VBA Code :-
Sub ReturnProps()
With ThisDocument.SmartTags(1).Properties(1)
MsgBox "The Smart Tag name is: " & .Name & vbLf & .Value
End With
End Sub
C# Code :-
public void ReturnProps()
{
object inderxId =1;
ThisDocument mydoc = new ThisDocument();
string name = "";
name = mydoc.SmartTags.get_Item(ref inderxId).Properties.get_Item(ref inderxId).Name;
string value = "";
value = mydoc.SmartTags.get_Item(ref inderxId).Properties.get_Item(ref inderxId).Value;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment