Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-25-2010, 03:41 AM
louise_chapman louise_chapman is offline Macros not working in word 2010 Windows XP Macros not working in word 2010 Office 2010 (Version 14.0)
Novice
Macros not working in word 2010
 
Join Date: Oct 2010
Posts: 3
louise_chapman is on a distinguished road
Default Macros not working in word 2010


Hello, im new here and need some help please. I designed a request form in microsoft 2003-2007 that had headings and then a field next to it which i created and assigned a macro to to make the field mandatory so that anyone filling out the request form filled in all the relevant details before they could send it. My work then upgraded my pc to word 2010 and it wiped out all my macros. I have re-written my macros exactly the same and assigned them to all the relevant fields, I have gone on Trust centre and set it to accept macros and saved it as a word - macro enable document and protected it. When i open the document it does not run the macros unless i manually do it and i need it to run upon opening the document as its being sent to different offices and they dont know about macros. Any help would be greatly appreciated, thankyou. The macro I use is:

Sub MustFillIn()
If ActiveDocument.FormFields("Text1").Result = "" Then
Do
sInFld = InputBox("This is a mandatory field and must be filled in, please fill in below.")
Loop While sInFld = ""
ActiveDocument.FormFields("Text1").Result = sInFld
End If
End Sub
Reply With Quote
  #2  
Old 10-25-2010, 08:20 AM
louise_chapman louise_chapman is offline Macros not working in word 2010 Windows XP Macros not working in word 2010 Office 2010 (Version 14.0)
Novice
Macros not working in word 2010
 
Join Date: Oct 2010
Posts: 3
louise_chapman is on a distinguished road
Default

Hi I've figured it out just incase anyone else has been having a simiular problem, when setting your permissons for protecting the document set it to 'filling out forms' and this then runs the macros, its always the simple things! so as long as you have edited your trust setting etc in the new word, save the doc & re-open it and your macros will run
Reply With Quote
  #3  
Old 10-25-2010, 08:29 AM
Kimberly Kimberly is offline Macros not working in word 2010 Windows 7 Macros not working in word 2010 Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Posts: 517
Kimberly is on a distinguished road
Default

Change the first line to
Sub AutoOpen()

EDIT: It runs when you open the doc?
Reply With Quote
  #4  
Old 10-25-2010, 08:34 AM
louise_chapman louise_chapman is offline Macros not working in word 2010 Windows XP Macros not working in word 2010 Office 2010 (Version 14.0)
Novice
Macros not working in word 2010
 
Join Date: Oct 2010
Posts: 3
louise_chapman is on a distinguished road
Default

It was doing but that was in an old version i've sent it to another user to see it works when its been sent on. I've just edited the 1st line with your suggestion and that works perfectly so going to change them all now (theres 48 in the document!) thank you so much for your help i've been pulling my hair out for days trying to figure it out, i much prefer the old word version!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste not working correctly Word 2010 wapanap Word 0 09-13-2010 06:29 PM
Macros -Problem Word 2010 Lyn Word VBA 0 08-19-2010 08:10 AM
Word Macros systechguy Word VBA 2 07-12-2010 01:26 PM
Word macros Clancy Word VBA 1 05-12-2010 02:05 AM
Macros in Word khamilton Word 0 11-22-2009 06:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft