I started with a simple word document with text and text boxes on it. I then wrote a vb application to store each record in a access database.I would like to press a command button on the vb application open the(saved word document with empty textboxes) and send the information to the document’s text boxes so I can print. Can this be done and if so would you point me in the right direction. I would like to do this so I do not have to reproduce this document (it is large and needs to be in a specific format). Using VB6 and Windows 98 word2000 User will be using w/95 and word 97 and will not have access2000 Just the Database. Thanks
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
vb application to word document
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » vb application to word document
- This topic has 2 replies, 3 voices, and was last updated 24 years ago.
Viewing 1 reply threadAuthorReplies-
WSVBNerd
AskWoody LoungerApril 13, 2001 at 6:16 pm #1782097One of my fellow programmers says when users ask “Can this or that be done?”, “Anything can be done given enough time.”
Yes, I think it can be done. The hardest part would be automating Word 95. Word 95 uses WordBasic as it’s programming language and Word 97 & Word 2000 use VBA. Word 97 & Word 2000 can translate Word 95’s WordBasic with various degrees of success.
Here’s a couple of articles from Microsoft
This link talks about WordBasic
http://msdn.microsoft.com/library/techart/msdn_wbmigrat.htmAnd this link talks about automating office…
http://support.microsoft.com/support/kb/ar…s/Q253/2/35.ASP -
WSRMittelman
AskWoody LoungerApril 13, 2001 at 8:17 pm #1782105I’m doing something like that, here’s how I did it:
The vb app needs a reference to the Microsoft Word 8.0 Object Library.
Dim out application and document objects:
Dim WordApp as Application
Dim MyDoc as DocumentCreate instances of these objects:
Set WordApp = GetObject(, “Word.Application”)
Set MyDoc = WordApp.Documents.Open(“C:My Documentsxxx.doc”). Or, if the document is already open:
Set MyDoc = WordApp.ActiveDocumentNote: the GetObject command assumes Word is already opened. If not opened, you have to use CreateObject instead. I’m not sure what the first parameter was for, you’ll have to search the help on that.
Anyway, once this works, you can have access to all of Word’s functionality, such as referencing the bookmarks collection, etc., just like from Word VBA.
Slight complication: In Word VBA, you can refer to things such as the application object, the selection object, etc. From VB, you need to be a little more specific. If referring to a Selection, you need to prefix it with the name of the application object: Instead of saying something like “Selection.Range…” you need to say “WordApp.Selection.Range…”, etc. Anytime you would refer to ActiveDocument in Word VBA, you can refer to MyDoc, the earlier created object.
Hope this helps. Feel free to e-mail questions.
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Align objects on a OneNote page
by
CWBillow
1 hour, 2 minutes ago -
OneNote Send To button?
by
CWBillow
1 hour, 45 minutes ago -
WU help needed with “Some settings are managed by your organization”
by
Peobody
10 hours, 18 minutes ago -
No Newsletters since 27 January
by
rog7
6 hours, 15 minutes ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
14 hours, 48 minutes ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
5 hours, 25 minutes ago -
Google One Storage Questions
by
LHiggins
17 hours, 8 minutes ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
12 hours, 24 minutes ago -
Ancient SSD thinks it’s new
by
WSila
9 hours, 23 minutes ago -
Washington State lab testing provider exposed health data of 1.6 million people
by
Nibbled To Death By Ducks
1 day, 1 hour ago -
WinRE KB5057589 fake out
by
Susan Bradley
18 hours, 26 minutes ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
9 hours, 5 minutes ago -
Firefox 137
by
Charlie
5 hours, 24 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
1 day, 13 hours ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
1 day, 13 hours ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
1 day, 13 hours ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
9 hours, 34 minutes ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
1 day, 17 hours ago -
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
1 day, 23 hours ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
2 days, 9 hours ago -
Office apps read-only for family members
by
b
2 days, 12 hours ago -
Defunct domain for Microsoft account
by
CWBillow
2 days, 9 hours ago -
24H2??
by
CWBillow
9 hours, 27 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
5 hours, 21 minutes ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
9 hours, 17 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
1 day, 8 hours ago -
two pages side by side land scape
by
marc
4 days, 10 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
4 days, 12 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
3 days, 15 hours ago -
Security Essentials or Defender?
by
MalcolmP
3 days, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.