Display User Form

C

Carol

Hi Bob,

You can show your form by clickin a macro button on your
toolbar. To create the button you must first add the
following code to your macro:

Sub autonew()
YourFormName.Show
End Sub

Then return to your template and do the following:

Tools/customize
Select the commands tab
select macros from the categories box on the left
right click autonew in the commands box in the right hand
side
hold, drag and drop on your toolbar
rename the button to a more appropriate name

Carol
 
B

Bob

Carol,

I did as you explained, but when I click the new button it still bugs out as
I mentioned below.
The macro:
Sub AutoNew()
'
' AddOurToolbar Macro
' Macro created 7/30/2003 by Bob Orta
'
frmMoveCurrentParagraph.Show
End Sub

If I use F5 to RUN the form the form displays, but I get a compile error:
Variable not defined and highlighted yellow: frmMoveParagraph.hide. The
form is supposed to hide. The form is an exercise in moving a paragraph up
or down. Here is the code behind the user form:

Private Sub cmdOK_Click()
frmMoveParagraph.hide
Unload frmMoveParagraph
If chkReturnToPreviousPosition = True Then
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="Move_Paragraph_Temp"
End With
End If
Selection.Extend
Selection.Extend
Selection.Extend
Selection.Extend
Selection.Cut

If optUpOne = True Then
Selection.MoveUp Unit:=wdParagraph, Count:=1
ElseIf optUpTwo = True Then
Selection.MoveUp Unit:=wdParagraph, Count:=2
ElseIf optDownOne = True Then
Selection.MoveDown Unit:=wdParagraph, Count:=1
ElseIf optDownTwo = True Then
Selection.MoveDown Unit:=wdParagraph, Count:=2
End If
Selection.PasteAndFormat (wdPasteDefault)

If chkReturnToPreviousPosition = True Then
Selection.GoTo What:=wdGoToBookmark, Name:="Move_Paragraph_Temp"
ActiveDocument.Bookmarks("Move_Paragraph_Temp").Delete
End If

End Sub


Bob
 
C

Carol

Bob,

Like you, I am new at Word and this is beyond my
expertise. I hope somebody else can help.

Carol
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top