msoPropertyTypeString throwing error in vba as an undefined variable - https://wordmvp.com/FAQs/MacrosVBA/MixedDocProps.htm

I've used a macro for years that includes the start:

Sub WriteProp(sPropName As String, sValue As String, Optional lType As Long = msoPropertyTypeString)

It just started (last week or so) throwing an error that msoPropertyTypeString is an undefined variable.

I do not pretend to understand the macro any more, if I ever did. It came from here.

https://wordmvp.com/FAQs/MacrosVBA/MixedDocProps.htm

I replaced msoPropertyTypeString with 4 and it now works.

https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.core.msodocproperties

I am trying to figure out what happened that this constant is no longer defined when used in vba.

|
Answer
Answer

It works fine for me in Office 365.

Check if your VBA Reference for Office 16 Object Library is marked.

________________________________
Richard V. Michaels
info@greatcirclelearning.com
Provides free AuthorTec add-ins for Mac & Win-Office. Site: greatcirclelearning.com

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 91 Applies to: