Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word VBA

Status
Not open for further replies.

selimsl

Programmer
Aug 15, 2005
62
TR
Hi!

How can I add text to a specific position of MS Word Page?
I search on the web,but I didn't find any code ,which achieve my desired effect.

Thanks in advice
 
As a starting point you may play with the macro recorder.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi selimsl,

Recording won't help - there is no VBA equivalent to the click-and-type of the GUI, and the answer, in general, is that it can't be done. Basically, a word processor does not cater to printing at a specific position - you would be better with a publishing package if that's what you want to do.

That said, it may be possible to achieve what you want in a specific instance, I don't know. If you can state it clearly, I or someone else can take a look at what might be possible.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Recording won't help
I disagree. You may record how you retrieve the specific location provided you use one search method instead of a manual scrolling and human looking.
 

Well, it depends what the OP means by "a specific position of MS Word Page". What I understand by a position on a page is not something one can search for - or explicitly specify in VBA (not for normal text anyway). If he really means something else, well maybe there's a solution.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
selinsl - you need to be more specific about what you want to do. You state you want to be able to insert text at a "specific position of a MS Word Page".


1. There is no Page in Word. And, therefore, there is no fixed "position". All locations are calculated.
2. There ARE location numbers.

So, are you trying to insert text a specific location within other text? If so, yes this can be done.

Are you trying to insert text at a specific distance from the margins (top/left)? Then again, yes, this could be done.

You need to state exactly what you are trying to do.

Tony and PHV - I agree with PH in that macro recording COULD help, but it depends on what exactly is trying to be achieved. I suspect, however, that Tony is correct in that, unless otherwise stated recording a macro will not help.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top