?
Solved

VBA translation of word macro.

Posted on 2004-08-22
4
Medium Priority
?
561 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

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