Link to home
Start Free TrialLog in
Avatar of Mike Eghtebas
Mike EghtebasFlag for United States of America

asked on

Read Frame properties... VBA

Question: What is the syntax to read the properties of a frame?
                   (Please verify and fill in the missing.)

ActiveDocument.Frames(intFrmCount).Select

   PageNoVal = ActiveDocument.Frames(intFrmCount).Range.Information(wdActiveEndPageNumber)
   PagesVal  = ?
   LeftVal  = ?
   TopVal  = ActiveDocument.Frames(intFrmCount).VerticalPosition
   FontSizeVal = Selection.Font.Size
   FontTypeVal  = ?
   BoldYNVal  = ?
   ItalicYNVal  = ?
   UnderLineYNVal = ?
   FrameWidthVal = ActiveDocument.Frames(intFrmCount).Width
   FrameHeightVal = ActiveDocument.Frames(intFrmCount).Height
   TextColorVal  = ?
   strVal= ActiveDocument.Frames(intFrmCount).Range.Text

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of geneus
geneus
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Eghtebas

ASKER

Thanks.
re:> PagesVal  = <= Unsure of what you are looking for here please add more info

This relates to total pages.
Sub PageCount()
MsgBox ActiveDocument.ComputeStatistics(Statistic:=wdStatisticPages)
PagesVal  = ActiveDocument.ComputeStatistics(Statistic:=wdStatisticPages)
End Sub
Following works:
       
PageNoVal = ActiveDocument.ComputeStatistics(Statistic:=wdStatisticPages)
       
PagesVal = ActiveDocument.Frames(intFrmCount).Range.Information(wdActiveEndPageNumber)

Thanks,

Mike
Hi geneus,

I have a follow up question at:

https://www.experts-exchange.com/questions/22872661/Frame-Location-VBA.html

Thanks,

Mike