VBA beginner - MS Word

jagadeesh.rt
NewLounger
Posts: 2
Joined: 14 Jun 2014, 03:17

VBA beginner - MS Word

Post by jagadeesh.rt »

Hi,

I am new to MS Word VBA beginner, please suggest any reference books / material - interested for VBA

Thanks in Advance
:smile:

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: VBA beginner - MS Word

Post by Rudi »

Hi,

Welcome to Eileen's Lounge :smile:

Here are some good online reading resources or tutorials you can start with:
-- http://www.susandoreydesigns.com/softwa ... niques.pdf
-- http://word.mvps.org/faqs/MacrosVBA/index.htm
-- http://shaunakelly.com/word/word-develo ... d-vba.html

Shauna's site also lists some other good resources like books at forums.

Of course you can easily find video tutorials on Youtube too regarding this subject.

I wish you well in your endeavours to learn this language. Remember that practice makes perfect and in actual fact, the best way to dig into VBA is to use that Host Application, record dozens of small macros and study up and experiment with the code hands on. The reading material is really just there to confirm and bolster the knowledge that you gain from doing it yourself.

If you have further questions or are in need of assistance, feel free you log in again and ask your questions here.
There are always members who are willing to lend a hand.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

jagadeesh.rt
NewLounger
Posts: 2
Joined: 14 Jun 2014, 03:17

Re: VBA beginner - MS Word

Post by jagadeesh.rt »

Thanks Rudi :thankyou:

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: VBA beginner - MS Word

Post by macropod »

Be aware, that VBA isn't Word's only programming language. Aside from its predecessor, WordBasic (which can still be used), Word has a field code environment for programming various things.

To see how use fields to do just about everything you might want to do with dates in Word, check out my Microsoft Word Date Calculation Tutorial, at:
http://windowssecrets.com/forums/showth ... n-Tutorial" onclick="window.open(this.href);return false;
or:
http://www.gmayor.com/downloads.htm#Third_party" onclick="window.open(this.href);return false;

To see how to do a wide range of mathematical calculations in Word, check out my Microsoft Word Field Maths Tutorial, at:
http://windowssecrets.com/forums/showth ... s-Tutorial" onclick="window.open(this.href);return false;
or:
http://www.gmayor.com/downloads.htm#Third_party" onclick="window.open(this.href);return false;

To see how to group mailmerge data with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial at:
http://windowssecrets.com/forums/showth ... e-Tutorial" onclick="window.open(this.href);return false;
or:
http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip" onclick="window.open(this.href);return false;
The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it.

For some worked examples, see the attachments to the posts at:
http://www.msofficeforums.com/mail-merg ... #post23345" onclick="window.open(this.href);return false;
http://www.msofficeforums.com/mail-merg ... #post30327" onclick="window.open(this.href);return false;
http://windowssecrets.com/forums/showth ... post928391" onclick="window.open(this.href);return false;
Paul Edstein
[Fmr MS MVP - Word]

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: VBA beginner - MS Word

Post by Rudi »

TX Paul...Good Links.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: VBA beginner - MS Word

Post by ChrisGreaves »

macropod wrote:Be aware, that VBA isn't Word's only programming language. Aside from its predecessor, WordBasic (which can still be used), ...
Hi Macropod.
Are the WordBasic. objects still permitted in Word2013?
(signed) "Curious, and Old-Fashioned" of Toronto. :grin:
An expensive day out: Wallet and Grimace

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA beginner - MS Word

Post by HansV »

Yes: Application.WordBasic Property (Word):
Office 2013
Published: July 16, 2012

Returns an automation object (Word.Basic) that includes methods for all the WordBasic statements and functions available in Word version 6.0 and Word for Windows 95.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: VBA beginner - MS Word

Post by ChrisGreaves »

HansV wrote:Yes: ... Returns an automation object (Word.Basic) ...
Thanks Hans.
Have you seen the WordBasic. functioning in 2013?
I'm trying to track down an Incompatibility issue; Rudi reported it with my code; I've had one other report from a stranger who downloaded my Indxr.
Both applications use my 18-year-old Utility library, which has been bopping along reasonably happily all this time.

Short of buying ( :crybaby: ) a copy of 2013 ...
An expensive day out: Wallet and Grimace

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA beginner - MS Word

Post by HansV »

I don't have Office 2013, so I can't test, sorry.
Best wishes,
Hans

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: VBA beginner - MS Word

Post by macropod »

Paul Edstein
[Fmr MS MVP - Word]

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA beginner - MS Word

Post by HansV »

That is exactly the same link as the one I posted, Paul. So WordBasic works in theory. Chris wants to know whether WordBasic still works the same way in practice as in earlier versions, since he gets reports that his utility library that uses WordBasic has compatibility issues.
Best wishes,
Hans

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: VBA beginner - MS Word

Post by macropod »

Hi Hans,

Sorry 'bout that - didn't notice the link in your previous post. Of course, any answer to the specifics of Chris' utility depends on knowing at least what WordBasic function is giving problems and under what circumstances.
Paul Edstein
[Fmr MS MVP - Word]

User avatar
Jay Freedman
Microsoft MVP
Posts: 1312
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: VBA beginner - MS Word

Post by Jay Freedman »

ChrisGreaves wrote:Have you seen the WordBasic. functioning in 2013?
I'm trying to track down an Incompatibility issue; Rudi reported it with my code; I've had one other report from a stranger who downloaded my Indxr.
Both applications use my 18-year-old Utility library, which has been bopping along reasonably happily all this time.

Short of buying ( :crybaby: ) a copy of 2013 ...
I use several of the WordBasic object's methods in all recent (2003 and later) versions of Word -- specifically, the FileNameInfo and DisableAutoMacros functions. I've also occasionally had uses for the SortArray function.

Here's a useful article: Useful WordBasic commands that have no VBA equivalent