View Single Post
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
gils usenet acct
 
Posts: n/a
Default import new Userform2 w/o overwriting existing Userform2?

Thanks All, ... sometimes it can be in plain view and still no obvious. But thank you and I've got it. I think I was getting twisted for two reasons. One, I would have thought right clicking on the name of the userform under Project would have been the route. Two, the presence of the UserForm caption name in addition to the UserForm name must have confused me.

As Always, Thanks !
Gil
http://www.TenSecondMedicalRecord.com
"Tony Jollans" My Forename at My Surname dot com wrote in message ...
You cannot have two userform2's - you must rename one or the other.

It's easy enough to rename the one you have in your project - just enter a new name in the properties window - but (perhaps not quite so easy) remember to change any references to it in your code as well.

Slightly more involved but perhaps a better solution is to edit the form you want to import. Exported userforms consist of two files - userform2.frm and (by default) userform2.frx - the key file is the one with the frm extension. It is just a text file and you can edit it in notepad.

It will look something like this:

VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} UserForm2
Caption = "UserForm2"
ClientHeight = 3120
ClientLeft = 45
ClientTop = 435
ClientWidth = 4710
OleObjectBlob = "UserForm2.frx":0000
StartUpPosition = 1 'CenterOwner
End
Attribute VB_Name = "UserForm2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

The name of the Userform is on the line which starts "Begin" - change this to your new name

The name of the Code module is on the line which begins Attribute VB_Name - this *MUST* be the same as the name of the userform so change it as well.

That is all you need to do. Save the file and then do your import.

It would perhaps be better to do a bit more if you are planning on using it more than once - otherwise it will end up being a source of confusion - but for a one-off that is sufficient.

--
Enjoy,
Tony

"gils usenet acct" wrote in message ...
Hi All,

I'd like to import a new "userform2" without overwriting my existing userform2. Is there a facile way to do this? It doesn't seem like you can rename a userform. ?

Gil
http://www.TenSecondMedicalRecord.com