Hello everybody,
Sometimes I meet this syntax “With...End With” in other languages and there I can not adapt it to my code in RB.
Is there an equivalent in RB of that command “With...End With”?
That function allows to add columns in a Word document.
With Selection.PageSetup.TextColumns
.SetCount NumColumns:=3
.EvenlySpaced = True
.LineBetween = False
.Width = CentimetersToPoints(16)
End With
my point was, the syntax is right… the code is wrong… you need to investigate those errors as your issue is no long related to WITH
something else you converted (or failed to convert) is now the issue
Its less than $20 USD and is written in a way that even dummies like me could get code up and going quick. You’ll realize the return on your investment in the first 30 minutes of usage!
Thank you all,
Until now I recorded a macro to know the code of each function so I do not really need a book but here at every line I have a problem and I still have 2.
Jeff thank you for your code. Indeed as you have presented it, we have the equivalent of “With … End with”.
Here is my last condensed code :
Word.Selection.PageSetup.TextColumns.SetCount(3) OK but doesn’t work with =
Word.Selection.PageSetup.TextColumns.EvenlySpaced = True // OLEexception error but working with False
Word.Selection.PageSetup.TextColumns.LineBetween = False // OK
Word.Selection.PageSetup.TextColumns.Width = Word.PointsToInches(16) OK but OLEexception error with CentimetersToPoints