Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-17-2011, 09:07 PM
b0x4it b0x4it is offline Fastest way to run a code Windows 7 32bit Fastest way to run a code Office 2010 32bit
Advanced Beginner
Fastest way to run a code
 
Join Date: May 2011
Posts: 95
b0x4it is on a distinguished road
Default Fastest way to run a code

If you are supposed to work with a new computer with newly installed office, and want to run a code that you have its source with you to the active document, what would be the fastest way to run it?

What I think is that to open the visual basic, copy/paste my code and select the Sub I want to run and just F5? Is there any other way like making that code a .vbs and opening it or somehow importing it over the active document? or any other method? I am looking for some kind of portable method that makes me able to have it with me anywhere and run it over any document in any Word, without having to create a Macro or button on the toolbar or using my own Normal.dot.



Thanks in advance for letting me know what you think.
Reply With Quote
  #2  
Old 05-17-2011, 09:23 PM
macropod's Avatar
macropod macropod is offline Fastest way to run a code Windows 7 32bit Fastest way to run a code Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could export the code module from your current document. Then, for your new document, import the code module. I doubt that's much quicker than simply saving the code as a plain text file (by copying & pasting into notepad), then copying & pasting from there into a code module in the new document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-17-2011, 09:33 PM
b0x4it b0x4it is offline Fastest way to run a code Windows 7 32bit Fastest way to run a code Office 2010 32bit
Advanced Beginner
Fastest way to run a code
 
Join Date: May 2011
Posts: 95
b0x4it is on a distinguished road
Default

If I import it, will it be saved in the current document? or in Normal.dot? It means if I send my document, the code will be with it too?

Do you know any shortcut for opening visual basic in Word?
Reply With Quote
  #4  
Old 05-17-2011, 09:46 PM
macropod's Avatar
macropod macropod is offline Fastest way to run a code Windows 7 32bit Fastest way to run a code Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by b0x4it View Post
If I import it, will it be saved in the current document? or in Normal.dot? It means if I send my document, the code will be with it too?
That depends on which you import it into.
Quote:
Do you know any shortcut for opening visual basic in Word?
Alt-F11
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-18-2011, 07:54 PM
b0x4it b0x4it is offline Fastest way to run a code Windows 7 32bit Fastest way to run a code Office 2010 32bit
Advanced Beginner
Fastest way to run a code
 
Join Date: May 2011
Posts: 95
b0x4it is on a distinguished road
Default

Thanks for your reply.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I add a peace of code to MS document amlife Word VBA 0 03-03-2010 03:35 PM
field code question bordercollie10 Mail Merge 3 10-15-2009 07:55 AM
VB Code.. COmbo boxes DrewB Word VBA 4 06-10-2009 05:31 AM
FileSaveAs with Code bsmith Office 0 01-05-2006 08:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:32 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