|
-
Jan 22nd, 2006, 07:37 AM
#1
Thread Starter
Lively Member
Word Grid position, some help
I use Word automation in my VB6 App
Is it possible to change the grid position?
I know i can display a grid in Word
And i can change its GridDistancehorizontal en GridDistancevertical
But i allso want to offset it's grid position with a left and top value!!
Is this possible, it's rahter important.
(I don't want the change the left and top Pagemargin of the Document)
Last edited by lvermeersch; Jan 23rd, 2006 at 06:44 AM.
-
Jan 22nd, 2006, 11:46 AM
#2
Re: Word Grid position
Returns or sets the point, relative to the top of the page, where you want the invisible grid for drawing, moving, and resizing AutoShapes
VB Code:
With ActiveDocument
[b].GridOriginHorizontal = InchesToPoints(1)
.GridOriginVertical = InchesToPoints(2)[/b]
.GridDistanceHorizontal = InchesToPoints(0.2)
.GridDistanceVertical = InchesToPoints(0.2)
.SnapToGrid = True
End With
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 23rd, 2006, 06:43 AM
#3
Thread Starter
Lively Member
Re: Word Grid position
I have tried the suggested .GridOriginHorizontal
I used
UMaat = 7 'Centimeter
Appword.ActiveDocument.GridOriginHorizontal = scalex(1, Umaat, vbPoints)
Now i allso tried
Appword.ActiveDocument.GridOriginHorizontal = 10
Appword.ActiveDocument.GridOriginHorizontal = 20
or some smaller values
But nothing change
if i use msgbox Appword.ActiveDocument.GridOriginHorizontal
I allways get value 5,65 as a result so the won't change it's value
What am i doing wrong?
I try redisplaying the grid but with no effect.
I do set the grid visible.
(and the other setting the .GridDistanceHorizontal does work fine)
Added info
OKE i just found it
I had to use first
.GridOriginFromMargin = false
This so the grid wont follow the marginssettings anymore.
Now it follows the Origin given through the code and it works fine
Last edited by lvermeersch; Jan 23rd, 2006 at 06:56 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|