Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Position in Text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jokobe - 26 Mar 2008 08:47 GMT
I want to make a textbox at the cursor-position.
I know how to make the text box, but how can I establish where the cursor is?
With this:
  ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 322.85, _
       538.85, 216#, 54#).Select
the textbox is always placed at the same position?

Thanks in advance for any helpful hint

jokobe
Helmut Weber - 26 Mar 2008 10:10 GMT
Hi Jokobe,

like that:

Sub Makro1()
Dim x As Single
Dim y As Single
x = Selection.Information(wdHorizontalPositionRelativeToPage)
y = Selection.Information(wdVerticalPositionRelativeToPage)
ActiveDocument.Shapes.AddTextbox( _
msoTextOrientationHorizontal, x, y, _
100, 100).Select
End Sub

Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Windows XP, Office 200
jokobe - 26 Mar 2008 20:12 GMT
Hi Helmut,

thanks for you answer, it is working now just the way I want it to work.

Jokobe

> Hi Jokobe,
>
[quoted text clipped - 13 lines]
> Helmut Weber, MVP WordVBA
> Windows XP, Office 200

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.