?????? ??: ????? ??????? ??????? (OLE) ?? Word

?????? ????????? ?????? ?????????
???? ???????: 184974 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

????? ??? ??????? ??? ????? ??????? ????? ????? ?????? ??? ????? ????? ????? Microsoft Word ?? ?????? ???. ?????? ??? ??????? ???? ??????? ???? sub-section "???????" ?? ????? ??? ???????.

??????? ????

???? Microsoft ??????? ???????? ??? ??? ?? ???? ??????? ?? ?? ????? ? ? ?? ????? ??? ?????? ???????? ??????? ?/?? ???????? ???? ????. ????? ??? ??????? ??? ????? ??? ??? ??????? ???? ?? ????? ???????? ????????? ?????? ????????? ????????. ???? ?? ????? ??????? ????? Microsoft ??? ????? ????? ???? ???? ?? ?????? ?????? ??? ??????? ?????? ????? ?????? ?? ????? ??????? ?????? ????????? ???????.
??? ??? ??? ?? ???? ???? ???? ?????? ?? ???? ???????? ?? ????? ??? ??????? ????? Microsoft ?? ????? ???????. ????? ?? ?????????? ?? ?????? ????? ??? Microsoft ???:

Microsoft ????????? Partners ? https://partner.microsoft.com/global/30000104

????? Microsoft ??????? ???? ???? ??????? - http://support.microsoft.com/gp/advisoryservice

?????? ??? ???? ?? ????????? ??? ?????? ????? ???????? ???? ????? ??????? ????? Microsoft ?? ?????? ???? Microsoft ?????? ??? ?????: http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
??????? ???????? (?????? ????? OLE) ?? ???? ????? ??????? ??????? ???? ???????? ?????? ??? ??? ????? ??????? ???? ??????? ???????? ?????? ???? ???? ???????. ??? ???? ??????? ?? ???? ?????? ???? ?????? ???? ????? ?? ??????, ?????? ?? ???? ?? ???????? ?? ???? ???? ???. ?? ???? ????? ?????? ???????? ??? ????? ?? ????? ? ????, ???? ????? ?????? ?? ?????.

????? ????? ?????? ???????, ????? ??????? Visual Basic for Applications ?????? ??? ?????? ??? ??? ???? ???. ?????? ??? ???????? ?? Visual Basic ?? ???? ??????? ?????? ??? ?????? ?? ?? ???? ?????? ??? ????? ????? ??????.

????? ??????? ????? ???????? ???????? ?? ??? ??????? ??? ???? ???? Microsoft Word ?? Microsoft Access 97 ?? Microsoft Excel 97 Microsoft PowerPoint 97 ???????? Microsoft Visual Basic ?? ?? ???? ??? ????? ??????? ?????? ?? Word.

?????? ?? ?????

???? ???? ????? ??????? ?????? Word ?? Windows.
  1. ????? ???? ??? ????? ???? 8.0 Microsoft Word.
  2. ????? ????? ???? ???? Word.
  3. ????? ???? ?? ??????? ?????? ???? CreateObject ??? ????? ?????? ???? ?? ??????? ?? ?????? 2.
  4. ??????? ??????? ????????? ????? ?????? ?????? Word.

???? 1: ????? ???? ??? ????? ?????? Word 8.0

?????? ???? ??? Word 8.0 ????? ?????? Microsoft ???????? Microsoft Access 97 ?? ?? Microsoft PowerPoint 97 ?? ?? Microsoft Excel 97 ???? ??????? ???????:
  1. ?? Microsoft Access ?? PowerPoint ?? Excel ?? ??????? ?????? ??? ??? ????? ?? ???? ??? ???? Visual Basic.
  2. ?? ???? Visual Basic ? ?? ??????? ?????? ???? ??? "???????".
  3. ?? ????? ??????? ???????, ???? ??? ???? ???????? (????????) ????? ?????? Microsoft Word 8.0.
??????: ?????? ?????? ???????? Microsoft Visual Basic 5.0 ???? "?????" ?? ??????? ???????.

????? ????? ?????? Microsoft 8.0 Word ???? ???? ?????? ?????? ??? ??????? Microsoft Word Online ???????? Word Microsoft Visual Basic for ????? ??????? ??????? ?????????. ???? ???????? ???? ????? ?????? 8.0 Word ?????? ????? ???????? Word ???????.

????? ???? ??? ????? ?????? 8.0 Word ???? ????? ??????.

????? ?? ????????? ??? ????? ?????? ?????? ?????? ??????? ??????? ?? "????? ??????? ?? Microsoft:
138138INFO: ??????? ? ???? ?????? ??? ????? ???????? ?? VB ?? ?????????

???? 2: ??????? ????? ????

????? ????? ????, ????? ????? ??????? ?????? ??? ????? ?? ????? ??? ??? ????? ????? ????? ??? ??????? ??????. ??? ???? ??????? Word.Application "?" ????????? "?" ???? ?? ?????? Word ??????.

???? ??? ??????? ?????? ?????? ?????? ????? objWD ????? ?? ??? Word.Application:

   Dim objWD as Word.Application

				

?????? 3: ????? ??? ?????

???? ????? ?? ??????? Visual Basic ????? ??????? "?????" ????? ?????? ???? ?? ?????? ?????? ??? Word: CreateObject ? GetObject. ????? ?????????? ???????? ???? ???? ?????? ???? CreateObject ???? ???? ?? Word, ????? ?????? ???? GetObject ????? ?? ??? ??????? ?????? ???? ?? Word. ????? ????? ??????? GetObject ???? ????? ???? ????? Word ?????.

???? ??????? ??????? ????? ??? ????? objWD Word ???????? ???? CreateObject:

   Dim objWD as Word.Application
   Set objWD = CreateObject("Word.Application")

				
???? ??????? ????? ??????? ????? ??????? objWdDoc ??? ????? Word ????:
   Dim objWdDoc As Word.Document
   Set objWdDoc = GetObject("c:\my documents\doc1.doc")
				
??????: ?? ???????? ??????? ???? CreateObject ?????? Word ?? Windows. ????? ???? GetObject ???? ??? ????? ?? ???? ????? WordMail ?? ??? ?? ????? ????? Word ?? ???? ?????? ???.

?????? ??? ???? ?? ????????? ??? ?????? ??? ??????? Visual Basic for Applications ?????? ?????? ??????? ??????? ?? "????? ??????? ?? Microsoft:
185232WordMail ??????? ??????? WD97: ?????: '??? ??????? ?? ??????? ??? ??????'

?????? 4: ??????? ????? ? ?????? ?????? Word

??? ????? ??????? 1-3 ? ????? ??????? ????? ?????? ?????? Word.

?????? ????? ??????? ?????? ??????? ???????? ????? ???? Word ????? ????? ???? ????? ??? ???? ???? ???????.
Sub AutomateWord()
   ' Declare the variable.
   Dim objWD As Word.Application
   ' Set the variable (runs new instance of Word.)
   Set objWD = CreateObject("Word.Application")
   ' Add a new document.
   objWD.Documents.Add
   ' Add some text.
   objWD.Selection.TypeText "This is some text."
   ' Save the document.
   objWD.ActiveDocument.SaveAs filename:="mydoc.doc"
   ' Quit Word.
   objWD.Quit
   ' Clear the variable from memory.
   Set objWD = Nothing
End Sub
				
??????: ????? ??????? ?????? ?????? ??????? ??????? ?? ????? AutomateWord ????? ?????? ?? Word:
Sub WordMacro()
   Documents.Add
   Selection.TypeText "This is some text"
   ActiveDocument.SaveAs filename:="mydoc.doc"
   Quit
End Sub
				

?????

????? ?? ?????????? ???? ????? Word ???????? Visual Basic for Applications ???? ??????? ???????.

???? ??? ?????? Microsoft Office

http://www.msdn.microsoft.com/office

???? Microsoft Office 97/Visual Basic ????????? ?????

???????? ??????? ?? ????? ?????? Microsoft Word Microsoft Office 97/Visual Basic ????????? ????? ?????? (ISBN: 1-57231-340-4).

- ?? -

??? ?????? ??? ?????? ??:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/office97/html/web/fulltoc.asp

??????? ???????

????? ??????? ??????? ???? - ??? - ???? ??????? ???????? ?? ??????? ?? ???????? ????? ?? Visual Basic for Applications:
microsoft.public.word.vba.addins
microsoft.public.word.vba.beginners
microsoft.public.word.vba.customization
microsoft.public.vb.ole.automation

???????

?????? ??? ???? ?? ????????? ??? ?????? ??? ??????? Visual Basic for Applications ?????? ?????? ???????? ??????? ?? "????? ????? Microsoft:
163435VBA: ????? ????? Visual Basic ?????????

173707OFF97: ????? ????? ????? ??????? ?????? ?? ?????? ????? ?????

163425WD97: ????? ????? ?????

????? Office

?????? ??? ???? ?? ????????? ??? ??????? ?? ???? Visual Basic ???? ??? "????? Office" ? ???? "??????? ????????" ? ???? ??? ??? ? ?? ???? ??? ???? "Communicating ?? ????????? ??????."

??????: ??? ??? ??????? ?????? ???? ??? ?? "????? Office" ??? ???? ??????? ?????. ??? ?? ??? ?????? ??? ??????? ??? ????????? ????? ?? "???????" ? ?????? ?????? ??????? ??????? ?? "????? ??????? ?? Microsoft:
176476?????? ??: ????? Office ?? ???? ??????? Visual Basic

???????

???? ???????: 184974 - ????? ??? ??????: 03/????/1428 - ??????: 4.3
????? ???
  • Microsoft Excel 97 Standard Edition
  • Microsoft Word 97 Standard Edition
  • Microsoft Visual Basic for Applications 5.0
????? ??????: 
kbmt kbdtacode kbhowto kbinterop kbprogramming KB184974 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????184974
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com