.


:




:

































 

 

 

 


Word




 

Word .

Reference... Microsoft Word Object Library.

 

Option Explicit

Dim objWord As Word.Application

 

Private Sub Command1_Click()

On Error Resume Next

Dim strDocPath As String, D

strDocPath = "D:\Advice\Soveti\DragDropTXT.doc"

Set objWord = New

Word.Application

objWord.Visible = False

objWord.Documents.Open strDocPath, False

objWord.Selection.WholeStory

D = objWord.Selection.Text

objWord.ActiveDocument.Close

objWord.Quit

Set objWord = Nothing

Debug.Print D

End Sub

 

 

 

, , .

Reference... Microsoft Word Object Library.

 

Private Sub Command2_Click()

DocWord.Application.Selection.PageSetup.LeftMargin = _ CentimetersToPoints(2) ' "2,0 "

DocWord.Application.Selection.PageSetup.RightMargin = _ CentimetersToPoints(1.5) ' "1,5 "

DocWord.Application.Selection.PageSetup.TopMargin = _ CentimetersToPoints(3.5) ' "3,5 "

DocWord.Application.Selection.PageSetup.BottomMargin = _ CentimetersToPoints(4.45) ' "4,45 "

End Sub

 

 

10 2 .

Tables. Reference... Microsoft Excel Object Library.

 

Dim TableWord As Word.Table '

Generals

Set TableWord = DocWord.Tables.Add(DocWord.Range(), 10, 2)

,

("" )

Set TableWord = DocWord.Tables.Add(DocWord.Application._ Selection.Range, 10, 2) ,

""

 

 

Excel

 

, , , .

Reference... Microsoft Excel Object Library.

 

For Each Workbook In Application.Workbooks

If Workbook.Name = " (Book1)" Then Stop

Next

 

 

Excel ListBox

 

Reference... Microsoft Excel Object Library.

ListBox1, , A1-B4 , .

 

Private Sub UserForm_Initialize()

ListBox1.ColumnCount = 5

ListBox1.RowSource = "a1:b4"

ListBox1.ControlSource = "a6"

ListBox1.BoundColumn = 0

End Sub

Excel

 

Reference... Microsoft Excel Object Library.

 

Dim ExNew As Worksheet

 

Set ExNew = ActiveWorkbook.Worksheets.Add

ExNew.Name = " "

 

 

Excel

 

, .

 

Private Declare Function ShellExecute& Lib "shell32.dll"_

Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _

lpOperation As String, ByVal lpFile As String, ByVal _

lpParameters As String, ByVal lpDirectory As String, _

ByVal nShowCmd As Long)

Private Declare Function GetDesktopWindow Lib_

"user32" () As Long

Const SW_SHOWNORMAL = 1

 

Sub Button1_Click()

Call ShellExecute(GetDesktopWindow, "Open",_

"www.armentel.com/avb", "", "c:\", SW_SHOWNORMAL)

End Sub

 

 

 

Sheet1.

Reference... Microsoft Excel Object Library.

 

For Each sheet In Worksheets

If sheet.Name = "Sheet1" Then

MsgBox "Sheet1 "

Exit For

End If

Next

 

 





:


: 2016-10-30; !; : 351 |


:

:

.
==> ...

1559 - | 1388 -


© 2015-2024 lektsii.org - -

: 0.01 .