header + footer babe boo

Posted: March 26, 2012 in Uncategorized

Sub Macro11()

‘ Macro11 Macro
‘ Macro recorded 1/29/2007 by Jeff

If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
 ActiveWindow.Panes(2).Close
 End If
 If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
 ActivePane.View.Type = wdOutlineView Then
 ActiveWindow.ActivePane.View.Type = wdPrintView
 End If
 ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
 Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
 Selection.TypeText Text:=”Bui Tan Phat    VN077       0028 “
 Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldDate
 Selection.TypeText Text:=” “
 Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldTime
 Selection.Find.ClearFormatting
 
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
 ActivePane.View.Type = wdOutlineView Then
 ActiveWindow.ActivePane.View.Type = wdPrintView
 End If
 ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
 Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
    “FILENAME “, PreserveFormatting:=True
 Selection.TypeText Text:=” “
 Selection.TypeText Text:=”Created on”
 Selection.TypeText Text:=” “
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
    “PAGE “, PreserveFormatting:=True
 ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub

Advertisements

HEader

Posted: March 25, 2012 in Uncategorized

Sub nanana()

‘ nanana Macro

‘ nananana

    Selection.WholeStory

    Selection.Shading.Texture = wdTextureNone

    Selection.Shading.ForegroundPatternColor = wdColorAutomatic

    Selection.Shading.BackgroundPatternColor = wdColorYellow

    With Selection.Tables(1)                                                                                               

        With .Borders(wdBorderLeft)

            .LineStyle = wdLineStyleSingle

            .LineWidth = wdLineWidth300pt

            .Color = 12611584

        End With

        With .Borders(wdBorderRight)

            .LineStyle = wdLineStyleSingle

            .LineWidth = wdLineWidth300pt

            .Color = 12611584

        End With

        With .Borders(wdBorderTop)

            .LineStyle = wdLineStyleSingle

            .LineWidth = wdLineWidth300pt

            .Color = 12611584

        End With

        With .Borders(wdBorderBottom)

            .LineStyle = wdLineStyleSingle

            .LineWidth = wdLineWidth300pt

            .Color = 12611584

        End With

        With .Borders(wdBorderHorizontal)

            .LineStyle = wdLineStyleSingle

            .LineWidth = wdLineWidth300pt

            .Color = 12611584

        End With

        .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone

        .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone

        .Borders.Shadow = False

    End With

    With Options

        .DefaultBorderLineStyle = wdLineStyleSingle

        .DefaultBorderLineWidth = wdLineWidth300pt

        .DefaultBorderColor = 12611584

    End With

   

 If ActiveWindow.View.SplitSpecial <> wdPaneNone Then

 ActiveWindow.Panes(2).Close

 End If

 If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _

 ActivePane.View.Type = wdOutlineView Then

 ActiveWindow.ActivePane.View.Type = wdPrintView

 End If

 ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader

 Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

 Selection.TypeText Text:=”Nguyen Tuan Anh                          VN077                               0043″

 Selection.Find.ClearFormatting

 

 If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _

 ActivePane.View.Type = wdOutlineView Then

 ActiveWindow.ActivePane.View.Type = wdPrintView

 End If

 ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

 

  Application.PrintOut FileName:=””, Range:=wdPrintAllDocument, Item:= _

        wdPrintDocumentContent, Copies:=1, Pages:=””, PageType:=wdPrintAllPages, _

        ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _

        False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _

        PrintZoomPaperHeight:=0

 

End Sub

anthony cute

Posted: March 23, 2012 in Uncategorized

Private Sub Document_New()

Dim ThisWordWindow As Word.Application

Dim ThisDocument As Document

Dim ThisCursor As Selection

Dim Name As String

Dim Address As String

Dim Base As Double

Dim Height As Double

 

Set ThisWordWindow = GetObject(, “Word.Application”)

Set ThisDocument = ThisWordWindow.ActiveDocument

Set ThisCursor = ThisWordWindow.Selection

 

Menu:

Selection = InputBox(“Please one of the options below:” _

+ Chr$(10) + “1.Insert Picture” _

+ Chr$(10) + “2.Insert Text” _

+ Chr$(10) + “3.Personal Details” _

+ Chr$(10) + “4.Calculate are of the triangle” _

+ Chr$(10) + “Q.Quit”, “Options Menu”)

Select Case Selection:

Case “1”:

InsertPicture (“C:\Users\Thoai\Pictures\235217.jpg”)

Case “2”:

Name = InputBox(“What is your name?”, “Name Prompt”)

ThisCursor.TypeText (“Dear ” + Name) + Chr$(10)

ThisCursor.TypeText (“I have the pleasure providing you the information”)

Case “3”:

Address = InputBox(“What is your address?”, “address prompt”)

MsgBox (“Your address is” + Str$(Address) + Chr$(10))

Case “4”:

Base = InputBox(“What is the base of the triangle?”, “Base Prompt”)

Height = InputBox(“What is the height of the triangle?”, “Height Prompt”)

Result = Base * Height / 2

MsgBox (“The area of the triangle is” + Str$(Result) + Chr$(10))

Case “Q”:

GoTo Menu

End Select

End Sub

 

Sub InsertPicture(Filename As String)

Dim ashape As Shape

Set ashape = ActiveDocument.Shapes.AddPicture(Filename)

ashape.WrapFormat.Type = wdWrapSquare

End Sub

selection

Posted: March 23, 2012 in Uncategorized

Private Sub Document_New()
Dim ThisWordWindow As Word.Application
Dim ThisDocument As Document
Dim ThisCursor As Selection
Dim Selection As String
Dim UserName As String
Dim Document As String
Dim Picture As String

Set ThisWordWindow = GetObject(, “Word.Application”)
Set ThisDocument = ThisWordWindow.ActiveDocument
Set ThisCursor = ThisWordWindow.Selection
Menu:
UserName = InputBox(“What is your username?”, “UserName”)
ThisCursor.TypeText (UserName + Chr$(10))

Selection = InputBox(“What type of document do you want to select?” _
+ Chr$(10) + “1. Letter” _
+ Chr$(10) + “2. Short notice” _
+ Chr$(10) + “3. Report” _
+ Chr$(10) + “Q. Quit”, “Options Menu”)

If Selection = “1” Then
ThisCursor.TypeText (“Letter” + Chr$(10))
Picture = InputBox(“What picture you want to insert?”, “Picture”)
InsertPicture (“H:\” + Picture)
ElseIf Selection = “2” Then
ThisCursor.TypeText (“Short notice” + Chr$(10))
Picture = InputBox(“What picture you want to insert?”, “Picture”)
InsertPicture (“H:\” + Picture)
ElseIf Selection = “3” Then
ThisCursor.TypeText (“Report” + Chr$(10))
Picture = InputBox(“What picture you want to insert?”, “Picture”)
InsertPicture (“H:\” + Picture)
ElseIf Selection = “Q” Then
End
Else
GoTo Menu
End If
End Sub

Sub InsertPicture(FileName As String)
Dim ashape As Shape
Set ashape = ActiveDocument.Shapes.AddPicture(FileName)
ashape.WrapFormat.Type = wdWrapThrough

End Sub

insert picture

Posted: March 23, 2012 in Uncategorized

Private Sub Document_New()

Dim ThisWordWindow As Word.Application

    Dim ThisDocument As Document

    Dim ThisCursor As Selection

    Dim Selection As String

    Dim ashape As Shape

    

    Set ThisWordWindow = GetObject(, “Word.Application”)

    Set ThisDocument = ThisWordWindow.ActiveDocument

    Set ThisCursor = ThisWordWindow.Selection

    

Menu:

    Selection = InputBox(“What do you want to do?” _

        + Chr$(10) + “1. Entei” _

        + Chr$(10) + “2. Raikou” _

        + Chr$(10) + “3. Suicune” _

        + Chr$(10) + “4. Lugia” _

        + Chr$(10) + “Q. Quit”, “Options Menu”)

        

    Select Case Selection

    Case “1”

    InsertPicture (“H:\entei.png”)

    

    Case “2”

    InsertPicture (“H:\No__243___Raikou_by_Nyaasu.jpg”)

    

    Case “3”

    InsertPicture (“H:\Suicune.jpg”)

  

    Case “4”

    InsertPicture (“H:\Lugia.png”)

    

    

    Case “Q”

    GoTo Menu

    End Select

    End Sub

 

Sub InsertPicture(FileName As String)

    Dim ashape As Shape

    Set ashape = ActiveDocument.Shapes.AddPicture(FileName)

    ashape.WrapFormat.Type = wdWrapThrough

    

End Sub

 

calculation

Posted: March 23, 2012 in Uncategorized

Private Sub Document_Open()

    Dim ThisWordWindow As Word.Application

    Dim ThisDocument As Document

    Dim ThisCursor As Selection

    Dim Selection As String

    Dim Radius As Double

    Dim Height As Double

    Dim Result As Double

    Dim Width As Double

    Dim Base As Double

 

 

    Set ThisWordWindow = GetObject(, “Word.Application”)

    Set ThisDocument = ThisWordWindow.ActiveDocument

Set ThisCursor = ThisWordWindow.Selection

 

Menu:

    Selection = InputBox(“What do you want to do?” _

        + Chr$(10) + “1. Calculate the volume of a cylinder” _

        + Chr$(10) + “2. Calculate the area of a triangle” _

        + Chr$(10) + “3. Calculate the area of a rectangle” _

        + Chr$(10) + “4. Calculate the volume of a cone” _

        + Chr$(10) + “Q. Quit”, “Options Menu”)

  

    Select Case Selection

    Case “1”

        Radius = InputBox(“What is the radius of the circle?”, “Radius”)

        Height = InputBox(“What is the height of the circle?”, “Height”)

        Result = 3.14 * Radius ^ 2 * Height

        MsgBox (“The Result of the volume of the cylinder is” + Str$(Result) + Chr$(10))

        

    Case “2”

        Base = InputBox(“What is the base of the triangle?”, “Base”)

        Height = InputBox(“What is the height of the triangle?”, “Height”)

        Result = (Base * Height) / 2

        MsgBox (“The resut of the area of the triangle is” + Str$(Result) + Chr$(10))

    Case “3”

        Width = InputBox(“What is the width of the rectangle?”, “Width”)

        Height = InputBox(“What is the height of the rectangle?”, “Height”)

        Result = Width * Height

        MsgBox (“The result of the area of a rectangle is” + Str$(Result) + Chr$(10))

    Case “4”

        Radius = InputBox(“What is the radius of the base?”, “Radius”)

        Height = InputBox(“What is the height of the cone?”, “Height”)

        Result = (1 / 3) * 3.14 * Radius ^ 2 * Height

        MsgBox (“The resulf of the volume of the cone is” + Str$(Result) + Chr$(10))

    Case “Q”

    GoTo Menu

    End Select

 

End Sub

Love ICT

Posted: March 1, 2012 in Uncategorized

Private Sub Document_Open()

Dim ThisWordWindow As Word.Application

Dim ThisDocument As Document

Dim ThisCursor As Selection

Dim CustomerAddress As String

Dim CustomerName As String

Dim aShape As Shape

 

Set ThisWordWindow = GetObject(, “Word.Application”)

Set ThisDocument = ThisWordWindow.ActiveDocument

Set ThisCursor = ThisWordWindow.Selection

 

InsertPicture (“C:\Documents and Settings\200780934\Desktop\spring\pb.jpg”)

CustomerAddress = InputBox(“What’s your address?”, “Customer’s address prompt”)

ThisCursor.TypeText (“Address: ” + CustomerAddress) + Chr$(10) + Chr$(10) + Chr$(10)

CustomerName = InputBox(“What’s your name?”, “Customer’s address prompt”)

ThisCursor.TypeText (“Dear” + CustomerName) + Chr$(10) + Chr$(10)

ThisCursor.TypeText (“I have pleasure to meet you “) + Chr$(10) + Chr$(10)

 

End Sub

Sub InsertPicture(FileName As String)

    Dim aShape As Shape

    Set aShape = ActiveDocument.Shapes.AddPicture(FileName)

    aShape.WrapFormat.Type = wdWrapThrough

   

End Sub

 

Private Sub Document_Open()

    Dim ThisWordWindow As Word.Application

    Dim ThisDocument As Document

    Dim ThisCursor As Selection

    Dim Selection As String

    Dim Name As String

    Dim Address As String

    Dim Email As String

 

    Set ThisWordWindow = GetObject(, “Word.Application”)

    Set ThisDocument = ThisWordWindow.ActiveDocument

Set ThisCursor = ThisWordWindow.Selection

 

 Menu:  

    Selection = InputBox(“What do you want to do?” _

        + Chr$(10) + “1. Enter the student name only” _

        + Chr$(10) + “2. Enter the student name and address” _

        + Chr$(10) + “3. Enter the student name, address and e-mail” _

        + Chr$(10) + “Q. Quit”, “Options Menu”)   

 

    If Selection = “1” Then

        Name = InputBox(“What is the student’s name?”, “Name”)

        ThisCursor.TypeText (Name + Chr$(10))

    ElseIf Selection = “2” Then

        Name = InputBox(“What is the student’s name?”, “Name”)

        Address = InputBox(“What is the student’s address?”, “Address”)

        ThisCursor.TypeText (Name + Chr$(10) + Address)

    ElseIf Selection = “3” Then

        Name = InputBox(“What is the student’s name?”, “Name”)

        Address = InputBox(“What is the student’s address?”, “Address”)

        Email = InputBox(“What is the student’s e-mail address?”, “Email”)

        ThisCursor.TypeText (Name + Chr$(10) + Address + Chr$(10) + Email)

ElseIf Selection = “Q” Then

    End

Else

    GoTo Menu

    End If

End Sub