Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod crash desktop driver drivers error ethernet excel freeze games gaming hard drive hardware hdmi internet laptop malware memory missing monitor motherboard network printer problem ram random registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Word documents with VB objects, not working after saving and closing

Reply  
Thread Tools
animorph's Avatar
Junior Member with 4 posts.
 
Join Date: Feb 2010
Experience: Intermediate
09-Feb-2010, 12:52 AM #1
Solved: Word documents with VB objects, not working after saving and closing
I created a simple word file with some visual basic elements, with Word 2003: two text boxes, a command button, and two labels. The user is supposed to enter information in the text boxes, and watch the information appear in the labels when they click the command button. I got everything working with this simple code for the command button:

Private Sub CommandButton1_Click()
Label1.Caption = TextBox1.Text
Label2.Caption = TextBox2.Text
End Sub

I was happy. I saved the document, closed Word, and went for a coffee.... When I returned, I re-opened the file. I entered text into the textboxes, and hit the command button, though nothing happened. The labels stayed blank. I tried adding new functions, and editing the old one, and nothing worked. Do VB functions work one time only, when you create them? Or can you create them, save the file, and have it work in the future (I hope)?

Edit: I have attached the file I created.

Thank you
Attached Files
File Type: doc form.doc (30.5 KB, 35 views)

Last edited by animorph; 09-Feb-2010 at 12:59 AM.. Reason: added attachment
alsters's Avatar
Junior Member with 1 posts.
 
Join Date: Feb 2010
09-Feb-2010, 08:19 AM #2
Actually i am new commer in visual basic .so i gain a little bit.but from today i continioung to read your thread.thats why i am very pleasure to you.

____________
handicappers
animorph's Avatar
Junior Member with 4 posts.
 
Join Date: Feb 2010
Experience: Intermediate
09-Feb-2010, 10:51 AM #3
I figured out why my program was not running. Microsoft Word's Macro security level was set to high, and was automatically blocking all of my Visual Basic code. I went to Tools --> Macro --> Security --> And changed the security Level to "Medium". You have to close and re-open Microsoft Word after making this change.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:35 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.