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 2008

Tip: Looking for answers? Try searching our database.

Displaying Section of Document in popup Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony Starr - 21 Feb 2008 05:30 GMT
Hi All,

I am trying to craete a userform in my word document, so that when the user
clicks on a button the form will appear displaying Appendix 1 (a section),
of the current document.
(The idea is that when a person is answering questions in the document, they
are supposed to read various appendices before answering the questions)
I was going to use a rtf control (RICHTX32.OCX) on my form but when I try
and add this to the user form I get the message "The subject is not trusted
for the specified action".

I tried using the DHTMLSafe control with the following code

   pBookMark.Range.Sections(1).Range.Select
   frmShowSchedule.txtNote.Text = Selection.Text

but the text was not displayed correctly.

Any suggestions?

TIA
Tony
Tony Strazzeri - 24 Mar 2008 23:32 GMT
Hi Tony,

I don't think this is easily done.  The problem with the RTF control
is a known one.  It is caused by MS trying to restrict the possibility
that thr control could be used to run malicious code.  I have in fact
removed the use of the control from several template applications I
created for a client beause it the problem.  Although there is a
workaround to allow thr RTF to note generate -it involves a registry
entry change--  the error, I was finding that the change was often
undone by many regular MS updates.  The IT dept would roll something
out and not realise that it "broke" the fix and I would get people
complaining that my templates were broken.  Anyway this does not
directly address your need.

Have you considered something along the lines of opening the document/
Appendix  in a separate document/window?

The following code does this.  You may need to play around with the
windows sizes and positions depending on the size of your display
hardware.

Hope this helps.

Cheers!
TonyS.

   Dim thiswindow As Window
   Set thiswindow = Application.ActiveWindow

   NewWindow
   Selection.Find.ClearFormatting
   Selection.Find.Style = ActiveDocument.Styles("Appendix")
   With Selection.Find
       .Text = ""
       .Replacement.Text = ""
       .Forward = True
       .Wrap = wdFindContinue
       .Format = True
       .MatchCase = False
       .MatchWholeWord = False
       .MatchWildcards = False
       .MatchSoundsLike = False
       .MatchAllWordForms = False
   End With
   Selection.Find.Execute

   Windows.Arrange ArrangeStyle:=wdTiled

   Application.Resize Width:=540, Height:=678
   Application.Move Left:=540, Top:=2

   thiswindow.Activate
   Application.Move Left:=0, Top:=0
   Application.Resize Width:=540, Height:=675

Rate this thread:






 
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.