TroutKing 发表于 2022-7-6 22:30:27

I’m confused. (VBA Page Layout

The code below actually works. It sets up my acLayout limits and then sets up a new page for me in the Page Setup Manager.
 
However, it sets up my acLayout limits on the paperspace tab (which I want) but it creates the new Page Manager page on the modelspace tab (which I don’t want).
 
I can’t seem to see any reason for this to take place.
 
Can any of you plotting gurus help me understand what I did wrong and how I can create the new page in the Page Setup Manager in my paperspace tab to go along with its setup?
 

Option ExplicitPublic Sub CreatePageSetup()GoGetCanonicalMediaNamesCreate_24x36'Create_11x17MsgBox "            DONE"End SubPrivate Sub Create_24x36()******************** SET UP NEW PLOT LAYOUT LIMITSThisDrawing.ActiveSpace = acPaperSpaceDim NewLowerX As VariantDim NewLowerY As VariantDim NewUpperX As VariantDim NewUpperY As VariantDim sysVarName As StringDim xymin As VariantDim xymax As VariantNewLowerX = 0#NewLowerY = 0#NewUpperX = 36#NewUpperY = 24#sysVarName = "LIMMIN"   xymin = ThisDrawing.GetVariable(sysVarName)sysVarName = "LIMMAX"   xymax = ThisDrawing.GetVariable(sysVarName)xymin(0) = NewLowerX: xymin(1) = NewLowerYxymax(0) = NewUpperX: xymax(1) = NewUpperYThisDrawing.PaperSpace.Layout.SetWindowToPlot xymin, xymax********************** CREATE NEW PLOT LAYOUT Dim D_PlotSize As StringD_PlotSize = "User2314" '
页: [1]
查看完整版本: I’m confused. (VBA Page Layout