custom dialog

R

Rassiel

I tried to make a custom dialog for showing in a C# project interacting with a word application. I have a Form, for example, one name Form1, and when a user clicks a custom bar button i want to show the form, if i write, form1.Show() it gets into a loop and it dosent paint correctly, i guess i must use form1.showDialog() but i need to make that dialog child from the word application but i dont have any handle to the word application. Any solution?
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

In VBA, The purists will say you should use

Dim MyDlg As Form1
Set MyDlg = New Form1
MyDlg.Show
Set MyDlg = Nothing

The lazy will say you can use

Form1.Show 'No parentheses

I am not sure of the significance of your statement that you "don't have any
handle to the Word application" Your project is interacting with Word.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
J

Jezebel

And the die-hards will observe that people who use style 1 are much less
likely to post queries to these forums because their code doesn't work, than
those who use style 2.

(Apart from laziness, it actually has serious implications for the data
component of form modules, and the difference between Form_Initialize and
Form_Load.)


"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 
P

Peter Hewett

Can't agree more.

And if you want to use your UserForm as a true class module you have to
instantiate your form correctly! As the short cut method (UserForm.Show)
usually has an Unload UserForm (or Unload Me) statement in the UserForm.

Cheers - Peter
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

I obviously must not be a die-hard because I don't think I've ever seen a
post to these newsgroups where the problem was caused by the use of style 2.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

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