Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2012, 07:01 PM
tinfanide tinfanide is offline VBA: how can I know the position on a document? Windows 7 64bit VBA: how can I know the position on a document? Office 2010 32bit
Expert
VBA: how can I know the position on a document?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default VBA: how can I know the position on a document?

Suppose I want to add a textbox on a Word Document. Is there any ruler that tells me the exact position where I want to add the textbox? And what's the unit of the following statement?



Code:
Set newTextbox = docNew.Shapes.AddTextbox _         (Orientation:=msoTextOrientationHorizontal, _         Left:=100, Top:=100, Width:=300, Height:=200)
Reply With Quote
  #2  
Old 02-26-2012, 10:30 PM
macropod's Avatar
macropod macropod is online now VBA: how can I know the position on a document? Windows 7 64bit VBA: how can I know the position on a document? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Have you looked at Word's help file for the 'AddTextbox' method?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-27-2012, 06:46 AM
tinfanide tinfanide is offline VBA: how can I know the position on a document? Windows 7 64bit VBA: how can I know the position on a document? Office 2010 32bit
Expert
VBA: how can I know the position on a document?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Yes. I've read the addTextbox to a canvas method. But this is not answered in the help document. How can I know the points of the position I want? Cos the ruler does not show point.
Reply With Quote
  #4  
Old 02-27-2012, 03:24 PM
macropod's Avatar
macropod macropod is online now VBA: how can I know the position on a document? Windows 7 64bit VBA: how can I know the position on a document? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you want the ruler to display in points, go to Word Options|Advanced > Display and choose 'Points' from the 'Show measurements in units of' dropdown. However, this shouldn't be necessary as you can use Word's CentimetersToPoints function so that you can work in centimeters. For example, for the textbox you might use:
.Top = CentimetersToPoints(2)
and Word will interptret this as a 2cm offset. All very simple. There is also an InchesToPoints function.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
fix position for a segment in a doc tai Word 3 10-20-2011 01:04 PM
Pictures Not Staying In Position BrazzellMarketing Word 3 10-06-2011 06:54 AM
VBA: how can I know the position on a document? character spacing position disabled fogharty Word 2 07-27-2011 01:26 PM
Retrieve position of Cursor - x & y positions SDondeti PowerPoint 0 05-19-2011 11:39 AM
Problem with watermark position in msword Nandu4u Word 0 12-29-2009 09:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft