Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

runtime error 75 when trying to give a name to a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Yann - 30 Mar 2007 12:21 GMT
I want to create a userform by vba (word 2000)

here is the code :
(cut and pasted from http://support.microsoft.com/kb/204330/en)
I get a runtime error 75 when it reach the .name="Helloworld" line
(everything else works fine, the form is created, the caption and the
dimensions are correctly set when the .name line is skipped)

Sub BuildMyForm()
  Set mynewform = _
     ActiveDocument.VBProject.VBComponents.Add(vbext_ct_MSForm)
     With mynewform
        .Properties("Height") = 246
        .Properties("Width") = 616
        .name = "HelloWord"
        .Properties("Caption") = "This is a test"
     End With
End Sub

any idea ?
many thanks in advance
Rob - 30 Mar 2007 13:18 GMT
Typical of Microsoft to post code without any dimensioned variables. With
Word 2003, once I add the reference and dimension mynewform (as a variant
because I didn't feel like sorting though every type to get the right one) I
get no errors with that code. Are you sure you added the reference to
Microsoft Visual Basic for Applications Extensibility library?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.