-
1. Re: Setting Document Measurement Units
[Jongware] Apr 17, 2013 10:13 AM (in response to indesign_adam)Are you looking at the VB reference? Yur line looks suspiciously like a JavaScript line, and JavaScript does nothave the same syntax as VB.
A quick Google turned up the CS5 VB Reference; your Measurement example is on p. 28, but with different wording.
-
2. Re: Setting Document Measurement Units
indesign_adam Apr 17, 2013 11:03 AM (in response to [Jongware])Thanks, I changed the syntax but it still doesn't seem to work.
I see an error 424 in the log now. VB error descriptor says 'Object Required.' What am I missing here?
Set myDocument = myInDesign.Documents.Add Set oArgs = WScript.Arguments.Unnamed objTextFile.WriteLine("InDesign after Add Docs") If Err.Number <> 0 then objTextFile.WriteLine("After Obj Error = " & Err.Number) End If Err.Clear myDocument.marginPreferences.left = 0 myDocument.marginPreferences.right = 0 myDocument.marginPreferences.top = 0 myDocument.marginPreferences.bottom = 0 If Err.Number <> 0 then objTextFile.WriteLine("Set Margins: Error = " & Err.Number) End If Err.Clear myDocument.ViewPreferences.HorizontalMeasurementUnits = idMeasurementUnits.idInches myDocument.ViewPreferences.VerticalMeasurementUnits = idMeasurementUnits.idInches If Err.Number <> 0 then objTextFile.WriteLine("Set Measurement Units: Error = " & Err.Number) End If Err.Clear Set myPage = myDocument.pages(1) myPage.marginPreferences.left = 0 myPage.marginPreferences.right = 0 myPage.marginPreferences.top = 0 myPage.marginPreferences.bottom = 0 With myDocument.DocumentPreferences .PageHeight = oArgs.Item(1) .PageWidth = oArgs.Item(2) .PagesPerDocument = 1 End With
-
3. Re: Setting Document Measurement Units
indesign_adam Apr 17, 2013 11:07 AM (in response to indesign_adam)I think I had a similar problem before where the id___.id___ values were not working. To set UserInteractionLevel, I had to find the numeric value of idNeverInteract. Do you know why this is happening? Is there somewhere I can find a conversion for the id's?
-
4. Re: Setting Document Measurement Units
indesign_adam Apr 17, 2013 11:13 AM (in response to indesign_adam)http://jongware.mit.edu/iccs5.5js_html/iccs5.5js/pe_MeasurementUnits.html
Is this you?! If so, you are a prince among men. Thank you.
-
5. Re: Setting Document Measurement Units
[Jongware] Apr 17, 2013 12:10 PM (in response to indesign_adam)Um, yes I am -- that is, 'him', not the 'prince' part :-P You are welcome!
.. Can I talk you into switching over to JavaScript? Mind you, VB has its advantages for certain workflows: mainly because it allows data interchange between ID and Office software. But if you are beginning *anyway*, the 'learning curve' is quite similar, and you are bound to find other uses for JS.
-
6. Re: Setting Document Measurement Units
indesign_adam Apr 19, 2013 8:20 AM (in response to [Jongware])Yes, we usually write JS, but in this case I was augmenting an existing resource.
Thanks again.