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
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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 23 years, 11 months 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
-
Ubuntu 25.04 (Plucky Puffin) Beta released
by
Alex5723
1 hour, 19 minutes ago -
How to install App Store apps on an external SSD
by
Alex5723
2 hours, 13 minutes ago -
Where is Windows going?
by
Susan Bradley
3 hours, 31 minutes ago -
Does anyone know how can we convert OST to Office 365? (Awaiting moderation)
by
Sanchit Tandon
5 hours, 57 minutes ago -
Installing Feature Update Windows 11 24H2
by
geekdom
19 hours, 42 minutes ago -
Windows 11 Insider Preview build 27823 released to Canary
by
joep517
20 hours, 6 minutes ago -
Windows 11 Hotpatch
by
Hackmuss
3 hours, 23 minutes ago -
System Guard service error still won’t be fixed
by
Susan Bradley
20 hours, 45 minutes ago -
Operation ForumTroll: APT attack with Google Chrome zero-day exploit chain
by
Alex5723
14 hours, 56 minutes ago -
Troy Hunt of HaveIBeenPwned Phished
by
Lars220
11 hours, 57 minutes ago -
Microsoft Windows security auditing Code 5061
by
mpw
1 day, 9 hours ago -
Can’t display images in incoming Outlook 365 emails
by
WScopwriter
16 hours, 53 minutes ago -
Windows 11 Insider Preview Build 26200.5510 early builds of 25H2
by
Alex5723
18 hours, 21 minutes ago -
0Patch : Micropatches released for SCF File NTLM Hash Disclosure Vulnerability
by
Alex5723
17 hours, 51 minutes ago -
Select multiple emails and they all open up!
by
CeeJay
2 days, 10 hours ago -
How to remove an update preview
by
Gunny
13 hours, 15 minutes ago -
Third party add ins reminder
by
Susan Bradley
8 hours, 50 minutes ago -
OTF, which backs Tor, Let’s Encrypt and more, sues to save its funding
by
Nibbled To Death By Ducks
2 days, 4 hours ago -
Updating Windows 10 to Windows 11: 23H2 or 24H2?
by
Still Anonymous
2 days, 14 hours ago -
How can I update “Explorer Patcher”
by
WSplanckster
2 days, 16 hours ago -
Check out the home page for Signal
by
CAS
2 days, 14 hours ago -
Windows 11 and Trial version of MS Office
by
Tex265
2 days, 13 hours ago -
Windows 11 Insider Preview build 26120.3585 (24H2) released to BETA
by
joep517
2 days, 21 hours ago -
Windows 11 Insider Preview build 26200.5510 released to DEV
by
joep517
2 days, 21 hours ago -
Windows 11 Insider Preview Build 26100.3624 (24H2) released to Release Preview
by
joep517
2 days, 21 hours ago -
Limits on User Names
by
CWBillow
2 days, 17 hours ago -
MS-DEFCON 4: Mixed bag for March
by
Susan Bradley
17 hours, 56 minutes ago -
Non Apple Keyboards
by
pmcjr6142
19 hours, 12 minutes ago -
How to delete your 23andMe data – The Verge
by
AJNorth
2 days, 15 hours ago -
7 common myths about Windows 11 (Microsoft AD)
by
EyesOnWindows
2 days, 13 hours ago
Recent blog posts
- Where is Windows going?
- System Guard service error still won’t be fixed
- Third party add ins reminder
- MS-DEFCON 4: Mixed bag for March
- Classic and Extended Control Panel — no need to say goodbye
- Things you can do in 2025 that you couldn’t do in 2024
- Revisiting Windows 11’s File Explorer
- Planning ahead for migration
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.