If myrange.Style = "Heading 2" Then is where the error occurrs. The error message reads
"Overload resolution failed because no Public '=' can be called with these arguments:
'Public Shared Operator =(a As String, b As String) As Boolean':
Argument matching parameter 'a' cannot...
The following code works in VB but not in VBA. A word document is opened the code looks for a string of text. If it finds it, it checks to see if the style is Heading 2. VBA gives me an overload error. Thanks
Dim mheading2
mheading2 = 0
'
Set myRange = ActiveDocument.Content
'
With...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.