Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #61  
Old 07-03-2017, 05:20 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,294
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

The basic code in in the zipped document attached to post #2. Open that document and press Alt-F11 to open the VBA Editor and access the code. Variations on the code have been discussed in numerous subsequent posts.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #62  
Old 08-17-2017, 11:08 PM
crosling crosling is offline Windows 10 Office 2013
Novice
 
Join Date: Aug 2017
Posts: 2
crosling is on a distinguished road
Default Getting the macro to work

Hi Macropod

I am having difficulty to get your macro to work in my document. (I have never used macros before)

I have been creating a word template.
I copied across - Client and client details.
I dont know how to copy and paste the macro across so it will work in my template.

Also, does my template have to be saved as a word enabled template for it to work?

Thank you
Reply With Quote
  #63  
Old 08-17-2017, 11:13 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,294
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Without seeing your template, its impossible to diagnose the issue. Can you attach it to a post (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.

And yes, for the template to be able to use a macro you'd have to save it as a macro-enabled template.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #64  
Old 08-17-2017, 11:21 PM
crosling crosling is offline Windows 10 Office 2013
Novice
 
Join Date: Aug 2017
Posts: 2
crosling is on a distinguished road
Default

Thanks for the quick response.

I dont think it is an issue but more i dont know how to copy a macro from your document into mine
Reply With Quote
  #65  
Old 08-17-2017, 11:54 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,294
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Open the template, then the VBE (Alt-F11) and select the template's 'This Document' code module. Copy the code from the relevant post, then paste it into the template's 'This Document' code module. Exit the VBE (Alt-F11) and save the template as a macro-enabled template.

Done.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #66  
Old 10-03-2017, 12:19 AM
kinimv kinimv is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 4
kinimv is on a distinguished road
Default

Hi Paul, I am new to macros as well, and am looking for a solution to my problem without avail. I tried your zipped file, and understood how it work, but I need something more complex.

My document has a drop down list called 'Test Code.' Drop down options are 1,2,3...10
I want to make it such that whichever option is chosen, fields across the document are automatically filled in based on the option. For illustration, these fields are 'Test Objective', 'Test Conditions', etc. which are not successive fields, but are in different places. How do I implement this?

Thanks
Reply With Quote
  #67  
Old 10-03-2017, 01:24 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,294
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

See post #33: http://www.msofficeforums.com/word-v...html#post90264
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #68  
Old 10-08-2017, 06:52 PM
kinimv kinimv is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 4
kinimv is on a distinguished road
Default

Hey Paul,
I looked back to #9 and #19, and didn't quite understand what you were trying to say. I tried messing around with the code based on what I thought was trying to be said, but failed to implement it without getting error codes every time. I have attached my template.

Best,
Vik
Attached Files
File Type: docx Test Report Template Upload.docx (36.7 KB, 1 views)
Reply With Quote
  #69  
Old 10-08-2017, 06:54 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,294
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Since a docx file can't contain any macros and neither your post nor your document says what you're trying to achieve, I'm not in a position to advise.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #70  
Old 10-08-2017, 07:49 PM
kinimv kinimv is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 4
kinimv is on a distinguished road
Default

Sorry for the confusion. I messed up when removing the sensitive details and uploading. Here, I have attached it again.
What I'm trying to do is that when the Test Number is selected, I want the Description, Reason, and Objective to be filled in. I have filled these in to the values of the drop down list using '|', but I'm not able to have it print separately in different boxes.
Thanks
Attached Files
File Type: docm Test Report Template Upload.docm (43.7 KB, 3 views)
Reply With Quote
  #71  
Old 10-08-2017, 08:35 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,294
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

See attached.

Note: Unless you want spaces either side of your Description, Reason, and Objective outputs, you shouldn't have them in the TestNo control's values.
Attached Files
File Type: docm Test Report Template Upload.docm (50.5 KB, 3 views)
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #72  
Old 10-08-2017, 09:36 PM
kinimv kinimv is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 4
kinimv is on a distinguished road
Default

Thanks a lot for your help!
The spaces on the sides were just a holdover from the description I had previously, thanks for pointing it out.
Reply With Quote
Reply
Please reply to this thread with any new information or opinions.

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Multiple Entries dudeabides Office 1 07-04-2011 02:49 AM
Multiple task lists and multiple calendars kballing Outlook 0 01-18-2011 10:23 AM
Creating Multiple Contact Lists meltee78 Outlook 1 01-03-2011 09:45 PM
multiple calendar entries across a group halfhearted Outlook 0 10-11-2009 12:13 PM
Word Forms : Dropdown lists wferaera45 Word 0 04-06-2006 03:02 AM


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


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft