Solved

VBA translation of word macro.

Posted on 2004-08-22
4
522 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
Comment Utility
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
Comment Utility
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
Comment Utility
OK.
Looking forward to it.
Graham
0
 
LVL 32

Author Comment

by:ldbkutty
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now