如何用vb读取word文档中的内容,能把它显示在text中或者赋给一个变量?

jamezhou 2002-02-27 05:14:33
如何用vb读取word文档中的内容,能把它显示在text中或者赋给一个变量?
...全文
468 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sonicdater 2002-02-27
  • 打赏
  • 举报
回复
Set wrd = GetObject(, "Word.Application")
wrd.Visible = True
wrd.Documents.Open "C:\My Documents\Temp.doc"
'你要做的事
Set wrd = Nothing
======================================================
有关 Word.Application 对象的 参考:

Properties
===========
ActiveDocument property, ActivePrinter property, ActiveWindow property, AddIns property, Application property, Assistant property, AutoCaptions property, AutoCorrect property, BackgroundPrintingStatus property, BackgroundSavingStatus property, BrowseExtraFileTypes property, Browser property, Build property, CapsLock property, Caption property, CaptionLabels property, CommandBars property, Creator property, CustomDictionaries property, CustomizationContext property, DefaultSaveFormat property, DefaultTableSeparator property, Dialogs property, DisplayAlerts property, DisplayAutoCompleteTips property, DisplayRecentFiles property, DisplayScreenTips property, DisplayScrollBars property, DisplayStatusBar property, Documents property, EnableCancelKey property, FileConverters property, FileSearch property, FindKey property, FocusInMailHeader property, FontNames property, Height property, International property, IsObjectValid property, KeyBindings property, KeysBoundTo property, LandscapeFontNames property, Languages property, Left property, ListGalleries property, MacroContainer property, MailingLabel property, MailMessage property, MailSystem property, MAPIAvailable property, MathCoprocessorAvailable property, MouseAvailable property, Name property, NormalTemplate property, NumLock property, Options property, Parent property, Path property, PathSeparator property, PortraitFontNames property, PrintPreview property, RecentFiles property, ScreenUpdating property, Selection property, ShowVisualBasicEditor property, SpecialMode property, StartupPath property, StatusBar property, SynonymInfo property, System property, Tasks property, Templates property, Top property, UsableHeight property, UsableWidth property, UserAddress property, UserControl property, UserInitials property, UserName property, VBE property, Version property, Visible property, Width property, Windows property, WindowState property, WordBasic property.

Methods
========
Activate method, AddAddress method, AutomaticChange method, BuildKeyCode method, CentimetersToPoints method, ChangeFileOpenDirectory method, CheckGrammar method, CheckSpelling method, CleanString method, DDEExecute method, DDEInitiate method, DDEPoke method, DDERequest method, DDETerminate method, DDETerminateAll method, GetAddress method, GetSpellingSuggestions method, GoBack method, GoForward method, Help method, HelpTool method, InchesToPoints method, KeyString method, LinesToPoints method, ListCommands method, LookupNameProperties method, MillimetersToPoints method, MountVolume method, Move method, NewWindow method, NextLetter method, OnTime method, OrganizerCopy method, OrganizerDelete method, OrganizerRename method, PicasToPoints method, PointsToCentimeters method, PointsToInches method, PointsToLines method, PointsToMillimeters method, PointsToPicas method, PrintOut method (Application, Document, and Window objects), Quit method, Repeat method, ResetIgnoreAll method, Resize method, Run method, ScreenRefresh method, SendFax method, ShowClipboard method, ShowMe method, SubstituteFont method.

Events
=======
DocumentChange event, Quit event.
sonicdater 2002-02-27
  • 打赏
  • 举报
回复
使用 Set objWord = CreateObject("Word.Application")
zyl910 2002-02-27
  • 打赏
  • 举报
回复
http://www.csdn.net/expert/topic/489/489785.xml
kimryo 2002-02-27
  • 打赏
  • 举报
回复
Word ActiveX控件,要不就是interface,直接createobject.

742

社区成员

发帖
与我相关
我的任务
社区描述
VB 版八卦、闲侃,联络感情地盘,禁广告帖、作业帖
社区管理员
  • 非技术类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧