?????? ?? Office ???????? ???? ???????? ?? ????? ???? ????

???? ?????? ???? ??????
???? ID: 222101 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

??????

?? ???? ????? ???? ?? ?? ???????? ?? ????????? ?????? ???? ?? ??? Microsoft Office ??????????? ?? ??????? ?? ???? ?? ??????? ?? ???? ??? Office ????????? ??????? ?? ??? ????? ???????????? ???? ?? ???? ???? ?? ???? ??? ?? ???? ?? illustrates ?? ?? ?? ?? ???? ??? ??????? ??????? ??? stepping ??????? ?? ?????? ?? ?? ????? ????? ?? ???? ???? ?? ??? ?????? ??????? ??????? ???? ?? ??? ???????? ?? ?????? ?? ???? ?????? ???? ?? ??? ????

???? ???????

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

Office ??????????? ?? ??? ???????? ???? Office ????? ????????? ?? ??? ???? ???? ?? ?????? ??? ???? ???: Microsoft Office 97 Visual Basic ????????? ???? ?????? ?? ???
1-57231-339-0 ISBN

Microsoft Office 2000 Visual Basic ????????? ???? ?????? ?? ???
ISBN 1-57231-955-0?
???? ?????? MSDN ?? ?????? ??? ??? ???? ???? Microsoft Office ?? ??? ?????? ???? ?? ???? ?? ?? ???? ??????? ??? ???? ?? ??????? ????????, ?? ??? ????? ????:
HTTP://mspress.Microsoft.com
????? ?????? ???????? Office ????????? ?? ??? ??? ????? ?? ???? ???? ???? ???

?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
???????????????? 97 (?? 8.0)??????? 2000 (?? 9.0)??????? 2002 (?? 10)??????? 2003 (?? 11)
OfficeVbaoff8.hlpVbaoff9.chmVbaof10.chmVbaof11.chm
?????Acvba80.hlpAcmain9.chmAcmain10.chm, Vbaac10.chmACMAIN11.chm, VBAAC10.chm
ExcelVbaXl8.hlpVbaxl9.chmVbaxl10.chmVBAXL10.chm
MapPointN/AMappoint.chm (ver.2001)Mappoint.chmMAPPOINT.chmn (Ver. 2004)
OutlookVbaoutl.hlpVbaoutl9.chmVbaol10.chmVBAOL11.chm
PowerPointVbappt.hlpVbappt9.chmVbapp10.chmVBAPP10.chm
WordVbawrd8.hlpVbawrd9.chmVbawd10.chmVBAWD10.chm
?????Vbagrp8.hlpVbagrp9.chmVbagr10.chmVBAGR10.chm
FrontPageN/AVbafp4.chm, Vbafpom4.chmVbafpd10.chm, vbafpw10.chmVBAFPD10.chm, VBAFPW10.chm
??????Vbabdr8.hlpVbabdr8.hlpDiscontinued


Microsoft Office 97 ?? ??? ???? ??? ??????? ?? ?? ???????? ??? ?? ??????? ???:
C:\Program Files\Microsoft Office\Office
??? ???? Office 97 VBA ??? ????? ?? ???? ???? ????, ?? ??? ?????? ??????? ???? ?? ?? ???? ?? ?? ???????? ?? Office 97 ?????? ??? ????? ?? ??????? ???? ?? ??? VBA ??? ????? ?????? ?? ??? Office ????? ?????? ??? ???? ?? Outlook 97 VBA ??? ????? ?? ???? ?????? ??????? Office ????? ??? Outlook 97 VBA ??? ????? ?? ??????? ???? ?? ??????? ?? ??? ????? ?????????? ???? ?? Microsoft ???????? ??? ?????:
166738OL97: Visual Basic ??? ?? ??????? ???? ?? ??? ????
Microsoft Office 2000 ?? ??? ???? ??? ??????? ?? ?? ???????? ??? ?? ??????? ???:
C:\Program Files\Microsoft Office\Office\1033
Microsoft Office XP ?? ??? ???? ??? ??????? ?? ?? ???????? ??? ?? ??????? ???:
C:\Program Files\Microsoft Office\Office10\1033
C:\Program Files\Microsoft Office\Office11\1033
???:: Microsoft Office 2000, Microsoft Office XP ?? Microsoft Office 2003 ????? ????????? "????? ?????." ?? VBA ??? ?????? ??????? ???? ?????, ???? ?? ???? ?? ? ????? ??? ????? ?? ?? ?????????? ??? ??? ?? ?? ??? ???? ???? ???? ?? ?????? Office ??????????? ??? VBA ??? ?? ??????

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

?? ??????? ????, ???? ?? ??? ?? ??? ???????? ?? ????? ?? ??? ????? ?? ??? ?? ??????? ???:
  • VBA ??? ????? ?? ?????:

    Visual Basic ?????? ??? Office ????????? ?? ???, ????? ???????? ????, ?????????????????? ??????????? ??.. ????? ???????? ??????? ??, ???? ?????? ????? ??? ?? ????? ???? ?? ??? ????????????. ???? ?????? ????? ???? ?????? ?? ??? VBA ??? ????? ??? ?? ????? ??, ?? ?? ?? ????? ?? ???? ???????????????????????? ??????? ????, ???? ?? ??? ?? ??????? ?????? ?? ??? ??? ???
  • ??????? ??? ??? ?? ???? ??????? ??? ?????? ?????? ??? ?? ????? ????:

    In the Visual Basic Editor for the Office application, type the class, method, or property in the code window of a module or in theImmediate Window, highlight the text and press the F1 key. The Help topic for the item appears.
  • Use the Object Browser:

    Press the F2 key in the Visual Basic Editor for the Office application to display theObject Browser. TheObject Browser????????? exposes ??? ???? ?? ???? ?? ??? ?? ?? ???? ?? ??????? ???? ???? ???? ??? ?? ??????? ???? ?? ???? ?? ????? ?? ??? ?? ????? ?? ??? ???????? ??????? ??? ???? ??? ???? ?? F1 ????? ??????

???? ???? ??? ????? ???-?? ????, ???????, ?? ??? ?? ????? ???? ?? ????

??? ?? ???? ??? ???? ?? ?? ?????? ???????? ???? ?? ???????? ???? ?? ??? ???????? ????????? ?? ???, ?? ????? ??????? ???? ?? ??? ????????? ?????? ???????? ????? ?? ???? ???? Illustrate, suppose ?? ???????? ???? ?? ??? ?????? ???? ?? ??? ??? ??? ?? ?? ??? ???????? ????? ?? ?? ???? ???????? ?? ?? ?????? ?? ??? Microsoft Word ???? ????? ?? ???-?? ?? ????? ???? ?? ??? ??? ?? ???????; ?????? ???????? ?? ??? ??????? ?? ???? ???:
  1. Microsoft Word ??????? ?????
  2. ????? ????,??????????? ????????????? ?? ??? ?? ??? ??????? ?????? ??????? ????. ??? ?????? ??? ?? ??? ????? ?? ????? ????OK??????? ???? ?? ????
  3. ??? ??? ????????? ?? ??????? ?????
  4. ??????:???? ENTER ????? ??????
  5. ??????:???? ENTER ????? ??????
  6. ??????:???.
  7. ????? ????,??????????? ???????????? ?? ???????? ?? "C:\doc1.doc." ?? ??? ??? ??????
  8. ????? ?????????????? ???????? (?? ????? ??????????????? ????????????? ?? ?? ??? ?????????????? ?????).
  9. ?????? ???????? ???? ???????? ?? ????? ?? ?? VBA ??? ?? ????? ?? ??? ????? ??????????????? ????????????? ?? ?? ??? ??????????. ???? ??? ??? ?????? ?? ??? ?? ??? ???? ?? ????? ??????????. Visual Basic Editor ??????? ??? ?? ?????? ?? ??? ????? ???? ??:
     Documents.Add
     Selection.TypeText Text:="one"
     Selection.TypeParagraph
     Selection.TypeText Text:="two"
     Selection.TypeParagraph
     Selection.TypeText Text:="three"
     ActiveDocument.SaveAs FileName:="Doc1.doc", FileFormat:=wdFormatDocument,_
       LockComments:=False, Password:="", AddToRecentFiles:=True, _ 
       WritePassword:="", ReadOnlyRecommended:=False, _
       EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, _
       SaveFormsData:=False, SaveAsAOCELetter:= False
    					
?? ?? ???? ??? ??? ?? ?????? ??? ???? ?? ???? ???? ??? ???????? ???? ?? ????? ?? ????? ?? ?? ??????? ?? ??? ?? ????? ???? ?? ??? ??? ???????? ?????? ????? ???

??????? ??? ?? ?????? ?? ???? ?????? ?? ??????? ?? ??? ?? ?? ??? ???????: Documents.Add. ??????? ?????????????F1 ????? ?? Recorded ?????? ?? ??? ??? ??????? ?? ?????? ??? ???? ???? ?????? ????? ?? ????? ?????????? ???????:
  • "????????? ???" ??? ???? ?????????? ?? ???????????? ???? ???? ??? ????????? ?????? ???? ???
  • "????????? ???" ????????? ???????? ?? ???? ???? ???
??????? ???? ??? ?????? ?? ?????, ??????? ????add??? ??????? ?? F1 ????? ?? ?????? ??? ??? ???? ????? ???? ?? ?? ?? ???? ???????? ?? ??? ??? ????? ' ?????? ?????? ???? ????? ????,??????????? ????? ?? ??? ??? ???? ?? ???add????????? ?????? ?? ?????? ??? ??? ???? ???? ?????? ????? ?? ????? ?????????? ???????:
  • "?????? ????" ???? ?????????? ?? ?????? ???? ?? ??? ??? ???, ????? ???????? ?????? ???
  • "?????? ????" ?? ????, ????? ?? ?? ???????? ??? ?? ?? ?? ???? ????
?? ???? ?????? ??? ??????? ???? ??? ?????? ?? ???? ????: Selection.TypeText ???: = "??"? ??????? ?????????? ??????? ?? F1 ????? ?? ?????:
  • "??? ???" ??? ???????? ????? ?????? ?? ??????? ????? ?? ???????????? ???? ???? ???? ???
  • "??? ???" ????????? ???????? ?? ???? ???? ???
??????? ???? ??? ?????? ?? ?????, ??????? ????TypeText??? ??????? ?? F1 ????? ?? ?????:
  • "TypeText ????" ????????? ??? ?? ???????? ???? ???
  • "TypeText ????" ???????? ?????? ?? ?? ?????? ???? ??? ???
  • ???????? ?? ??? ???? ?? ??? "TypeText ????" ???? ???? ???
????, ?? ??? ??? ???? ?????TypeParagraph:
  • "TypeParagraph ????" ??? ????? ???????? ?? ???????? ???? ???
  • "TypeParagraph ????" ???????? ?? ??? ???? ?? ??? ???? ???? ?? ?? ?? ???? ???? ???
?? ??? ??? ???? ?? ???? ????ActiveDocument??? ??SaveAs????:
  • "ActiveDocument ???" ???? ???? ?? ???????? ?? ???????????? ???? ???? ??? ???????? ???????? ???? ??? "ActiveDocument" ????????? ???????? ?? ???? ???? ???
  • The "SaveAs method" saves a document. Depending on the version of Word, this method has from 11 to 16 arguments, only one of which is required. "SaveAs" applies to a Document object.
You may have noticed that the?????????property,???property, andActiveDocumentproperty are all properties that apply to the?????????object but yet are not qualified with "Application" in the recorded macro. The????????????????? ??? ????? ?? ??? ??????? ???????? ?? ?? ???? ?? ???? ??? ????? ???? ??? ??? ?? ?? VBA ?????? ??? ????? ???? ??? ?? ???? ??????? ??? ????? ???; ??? ??? ?? ??????? ????? ??? ???? ??????? ??? ????? ???? ??? ???? ?? ???? ???

??????? ???? ??? ?????? examination, ?? ?? ????? ????SaveAs?????? ?? ?? ???? ?? ????? ??? ?? passes ?????????? ???????? ??wdFormatDocument. ???????????? ???? ???? ??????? ???????? ?? ??? ?????, ?? ???? ?? ?? ?????????? ????? ?? ??? ???????? ??? ?? ??? ???? ?? ???????? ????? ?? ??? ??? ????SaveAs???? ?? ??????? ?????? ???? ????? ?? ??? ??? ???? ???? ??????????? ???????. ????????? ???? ?? ??? F2 ????? ????????????? ???????. ??????::

wdFormatDocument

ENTER ????? ?? ??? ????? ??? ?????? ?? ????? ??????????? ???????, ???? ?? ?????? ???? ?????wdFormatDocument(=0)???????? ?? ???? ??? ??????? ?? ?? ??? ??? ???? ???

??????

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

??? ?? ???????? ?? ?? ??????? ???? ?? ????? groundwork ??????? ??? ????? ?? ??? ??? Microsoft ???????? ??? ???? Visual Basic, ????? C++ ?? MFC ??? ???? ?? ??????? ??? ????? ?? ?????? ?? ??? excellent ?????? ??? ???? ???? ??? ??? ???:

Visual Basic ???????? ?? ???

???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ???????? ????? ????::
220595Visual Basic ?? ????? ?? Outlook ?? ???????? ???? ?? ??? ???? ????
219151Visual Basic ?? Microsoft Excel ?? ??????? ???? ????
147650Visual Basic ?? Excel ???????? ??????? ???? ?? ??? ???? ????
142387Visual Basic ?? Excel ????? w/OLE ??????? ?? ????? ?? ??? ???? ????
184974Word ?? ??? (OLE) ??????? ?? ????? ???? ????
220607Visual Basic ?? ?? ??? ???? ???? ?? ??? Microsoft Word ?? ???????? ???? ?? ??? ???? ????
222929Office 2003 ???, Office XP ?????? ???, ?? Office 2000 ?????? ??? Visual Basic ?? ????? ?? PowerPoint ?? ???????? ???? ?? ??? ???? ????

????? C++ ???????? (MFC ?? ????? ????)

???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ???????? ????? ????::
178749MFC ?? ?? ?????? ????????? ?? ????? ???? ??? ??????? ????????? ????? ?? ??? ???? ????
179706Excel ???????? ?? ????? ?? ?? ?? ????????????? ?? ???????? ???? ?? ??? MFC ?? ????? ???? ????
186120Excel ???????? ?? ?? ???? ???? ??? ?? ???? ?????? ?? ???? ?? ??? MFC ?? ????? ???? ????
186122Excel 2002 ?? Excel 2000 ?? Excel 2002 ???????? ?? Excel 2000 ??? ?? ?????? ?? ??? ???? ?? ??????? ???? ?? ??? MFC ?? ????? ???? ????
220911???? ??? ???? ????? C++ ?? MFC ?? ????? ???? ?? ??? Microsoft Word ?? ???????? ???? ?? ??? ???? ????
222960Microsoft ????????? ???? ?? ??? ????? C++ 5.0 ?? ????? C++ 6.0 ?? ????? ?? PowerPoint ?? ???????? ???? ?? ??? ???? ????

(???? MFC) C/C++ ????????

???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ???????? ????? ????::
216686MFC ?? #import ?? ????? ??? ???? C++ ?? Excel ?? ???????? ???? ?? ??? ???? ????
181473???? ????????? ?? C ???? C++ ?? OLE ??????? ?? ????? ???? ????

????? J ++ ????????

???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ???????? ????? ????::
219430?????/??????? ???? ????? J ++ ??????? ?? ????? ?? Excel ????????????? ?? ??? ???? ????
215484????? J ++ 6.0 ?? ????? ?? PowerPoint ?? ???????? ???? ?? ??? ???? ????

????? FoxPro ????????

???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ???????? ????? ????::
142193Excel ????? ??? ???? ????? ?? ??? OLE ??????? ?? ????? ???? ????
180901Word 97 ?? Office Word 2003 ?? ????? FoxPro ?? ??? Windows 5.0 ?? ??? ?? ????????? ??? ??? categorized ?????? ?? ????? ?? ??? ???? ????
181926OLE ?? ODBC ?? ????? ?? Word ?? ??? ???? ?? ???????? ???? ?? ??? ???? ????
194306Word ????? FoxPro ?? OLE ??????? ?? ????? ???? duplex ?? ??????? ???? ?? ??? ???? ????
230154FoxPro ?? ????? ?? ????? ?? PowerPoint ?? ???????? ???? ?? ??? ???? ????
241942Word ?????? ?????? BackgroundPrintingStatus ?? ??? ?? ????? ?? ??? ???? ????
???????? ???????, ?????? ????? ??? ?? Microsoft Office ?? ??????? ?? ??? ?????? ?? ??? ????? Microsoft ??? ???? ?? ????:
HTTP://support.Microsoft.com/GP/ofd

???

???? ID: 222101 - ????? ???????: 02 ?????? 2010 - ??????: 2.0
???? ???? ???? ??:
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 4.0 Enterprise Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual C++ 4.0 Professional Edition
  • Microsoft Visual C++ 5.0 Professional Edition
  • Microsoft Visual J++ 6.0 Standard Edition
  • Microsoft Visual Studio .NET 2002 Professional Edition
  • Microsoft Visual Studio .NET 2003 Professional Edition
  • Microsoft Access 2002 Standard Edition
  • Microsoft Access 2000 Standard Edition
  • Microsoft Access 97 Standard Edition
  • Microsoft Excel 2002 Standard Edition
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Excel 97 Standard Edition
  • Microsoft FrontPage 2002 Standard Edition
  • Microsoft FrontPage 2000 Standard Edition
  • Microsoft Outlook 2002 Standard Edition
  • Microsoft Outlook 2000 Standard Edition
  • Microsoft Outlook 97 Standard Edition
  • Microsoft Outlook 98 Standard Edition
  • Microsoft PowerPoint 2002 Standard Edition
  • Microsoft PowerPoint 2000 Standard Edition
  • Microsoft PowerPoint 97 Standard Edition
  • Microsoft Word 2002
  • Microsoft Word 2000
  • Microsoft Word 97 Standard Edition
  • Microsoft Visual FoxPro 6.0 Professional Edition
  • Microsoft MapPoint 2002 Standard Edition
  • Microsoft MapPoint 2001 Standard Edition
??????: 
_ik11561 _ik11593 kbautomation kbgrpdso kbhowto kbvba kbvbp400 kbvbp500 kbvbp600 kbmt KB222101 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:222101

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

 

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