Solved

VBA translation of word macro.

Posted on 2004-08-22
4
540 Views
Last Modified: 2012-08-13
Dear Experts,

I need to translate a certain word macro. I heard it might be difficult.

I am an extreme new-bie for VB. I am suggested to use VBA. I dont know how VBA differs from VB.

I hope you might have suggestion for me in translating a certain word macro using VBA.

Thanks.
0
Comment
Question by:ldbkutty
  • 2
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 11865048
Word macros always use VBA, unless it was for Word 6 or earlier, which used Wordbasic.
VB6 and VBA code for Office 2000 are basically the same.

The environment is different so you have to get hold of the Word Objects to run the code for you.

I suggest that you set a reference (Project/References) to the Microsoft Word Object library, then

Dim wdAppl as Word.Application
Dim Doc as Word.Document
Set wdAppl as New Word.Application
Set Doc = wdAppl.Documents.Open("C:\myfolder\mydoc.doc")

Within Word the Application object is implicit and need not be stated. If it is the keyword Application is always used.

the equivalent of the last line could be

either
Set Doc = Application.Documents.Open("C:\myfolder\mydoc.doc")
or
Set Doc = Documents.Open("C:\myfolder\mydoc.doc")

It might  be an idea to post some of the code (or all if it isn't very long)
0
 
LVL 32

Author Comment

by:ldbkutty
ID: 11902860
Thanks for your help and Sorry for this late reply. I am out of this task now. I hope to get back in 2 or 3 days.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 11908036
OK.
Looking forward to it.
Graham
0
 
LVL 32

Author Comment

by:ldbkutty
ID: 11937635
Seems it will take time for me to get the word macro. I'll close the Question now and come back with some new Q Links.

Thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question