.


:




:

































 

 

 

 





, , , , , . . .

. . , . , :

1. Project/Add Form/ Existing, Add Form .

2. File/Save < > As . ( ).

3. .

4. .

:

1. Project/Add Form/ New, .

2. .

3. .

, .

( ) . , . , , .

. , . . , . , , .

, , :

, Load
Show
Show vbModal
Visible True Show
Visible False Hide
Unload

 

 

 

, :

- View / Code.

- View Code.

, . Object, .

General. : .

Object , (Form), . , Procedure , . General Object Declarations () Procedure.


2

MICROSOFT OFICE [1]

 

1. Word (*.txt)

 

Word .

Reference... Microsoft Word Object Library.

 

Private Sub Command1_Click()

Dim temp As String

temp = " & .doc"

If Not Dir(temp, vbNormal) <> "" Then

MsgBox " ."

Exit Sub

End If

On Error GoTo Notloaded

Set MyWord = GetObject (, "Word.Application")

Notloaded:

If Err.Number = 429 Then

Set MyWord = CreateObject("Word.Application")

ElseIf Err.Number <> 0 Then

Screen.MousePointer = vbDefault

' Cancel

MyWord.Documents.Close SaveChanges:= wdDoNotSaveChanges

Set MyWord = Nothing

Screen.MousePointer = 0

If Not Err.Number = 32755 Then

MsgBox Err.Description & vbCrLf & "error "

End If

Err.Clear

Exit Sub

End If

MyWord.Documents.Open FileName:=temp

MyWord.ActiveDocument.SaveAs FileName:="name.txt", _

FileFormat:=wdFormatText, LockComments:=False, _

Password:="", AddToRecentFiles:=True, WritePassword:="",_

ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _

SaveNativePictureFormat:=False, SaveFormsData:=False, _

SaveAsAOCELetter:=False

End Sub





:


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


:

:

.
==> ...

1506 - | 1431 -


© 2015-2024 lektsii.org - -

: 0.01 .