C
charlie.planetxsolutions
hi there,
i have some wordbasic code that i am attempting to convert to vba.
the following code just provides a 'type mismatch' error at the
ActiveDocument.Sections line... nothing i seem to do makes it funtion.
additionally, the original WordBasic.ToolsProtectSection line doesn't seem to
unprotect the section for me either.
If sDocumentCreatedBy$ <> "PROVISION_LIST_DOCUMENT" Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields,
Password:=sPassword$, NoReset:=True
'WordBasic.ToolsProtectDocument DocumentPassword:=sPassword$,
NoReset:=0, Type:=2
For i = 1 To iNumProtectedSections
If iUnprotectSectionNumbers__(i) > 0 Then
iSectionNumber$ = iUnprotectSectionNumbers__(i)
MsgBox "Debug: about to unprotect section: " +
Str(iSectionNumber$) + "."
ActiveDocument.Sections(iSectionNumber$).ProtectedForForms = False
'WordBasic.ToolsProtectSection
Section:=iUnprotectSectionNumbers__(i), Protect:=0
End If
Next
Else...
any assistance greatly appreciated.
i have some wordbasic code that i am attempting to convert to vba.
the following code just provides a 'type mismatch' error at the
ActiveDocument.Sections line... nothing i seem to do makes it funtion.
additionally, the original WordBasic.ToolsProtectSection line doesn't seem to
unprotect the section for me either.
If sDocumentCreatedBy$ <> "PROVISION_LIST_DOCUMENT" Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields,
Password:=sPassword$, NoReset:=True
'WordBasic.ToolsProtectDocument DocumentPassword:=sPassword$,
NoReset:=0, Type:=2
For i = 1 To iNumProtectedSections
If iUnprotectSectionNumbers__(i) > 0 Then
iSectionNumber$ = iUnprotectSectionNumbers__(i)
MsgBox "Debug: about to unprotect section: " +
Str(iSectionNumber$) + "."
ActiveDocument.Sections(iSectionNumber$).ProtectedForForms = False
'WordBasic.ToolsProtectSection
Section:=iUnprotectSectionNumbers__(i), Protect:=0
End If
Next
Else...
any assistance greatly appreciated.