MS Word 2000 - how to move focus to the message fody from email header ? 
Author Message
 MS Word 2000 - how to move focus to the message fody from email header ?

My client uses MS Word 2000 as email editor in Outlook 2000.
I wrote macro that is form activated by custom button, where user
needs to put some info. This info needs to be populated in email body.

The problem is that if the cursor is positioned in one of the
following fields : To, CC, Bcc, Subject - every time i try to populate
text from the form in the message body - I get error "Runtime error
4605" :
this method or property is not available because the current selection
is in email header"

if prior to clickin button and opening the form I position the cursor
in email body - everything works fine.

Any suggestions on how to move programmatically to the message body
(verify that cursor is in message body)  before text is inserted ?

Thx,

Alex  

P.S. here is the actual code :

Private Sub CommandButton1_Click()

  Dim strLink As String
  strLink = vbCrLf +
" http://www.*-*-*.com/ ;

  If Trim(txtPR.Text) <> "" Then
    If Application.FocusInMailHeader Then
      ActiveWindow.SetFocus
    End If

    Set myDocument = ActiveDocument
    myDocument.Bookmarks(1).Range.InsertBefore "yourdata" + txtPR.Text
    Call Unload(Me)

  Else
   MsgBox "Please enter PR Number"
  End If

End Sub



Wed, 20 Jul 2005 11:16:06 GMT  
 MS Word 2000 - how to move focus to the message fody from email header ?

Quote:
>My client uses MS Word 2000 as email editor in Outlook 2000.

G'day Alex,

this is perhaps about the worst thing you could do to a person.

Steve Hudson - Word Heretic, Sydney, Australia
I can do tricky stuff with Word or words for you.

http://www.geocities.com/word_heretic/products.html
Spellbooks: 3089 pages of dump left and dropping...
Word MVP FAQs: http://www.mvps.org/word/FAQs/index.html



Tue, 16 Aug 2005 18:05:53 GMT  
 MS Word 2000 - how to move focus to the message fody from email header ?
Not my choice :-( ; any suggestions on solution ?

Alex



Tue, 16 Aug 2005 23:39:50 GMT  
 MS Word 2000 - how to move focus to the message fody from email header ?

Quote:
>Not my choice :-( ; any suggestions on solution ?

G'day Alex,

negatory. It'd be some outlook code and I concentrate on Word as I am
a writer...

Steve Hudson - Word Heretic, Sydney, Australia
I can do tricky stuff with Word or words for you.

http://www.geocities.com/word_heretic/products.html
Spellbooks: 1987 pages of dump left and dropping...
Word MVP FAQs: http://www.mvps.org/word/FAQs/index.html



Fri, 19 Aug 2005 16:38:11 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Adding VBA to a MS Word 2000 Header -- How To

2. Adding code to a MS Word 2000 Header

3. Need a program to extract email addresses from MS Outlook 2000 folders/messages

4. Automating email function within Word 2000 using Access 2000

5. MS PJ 2000 and MS Word via VBA

6. Automatic Headers - Word 2000

7. Adjusting headers/footers in a macro in Word 2000

8. Change font of an Incoming Email message in Outlook 2000

9. Workgroup Messaging - TeamStatus email (2000/SR-1)

10. send email automatically from Filemaker via MS Outlook 2000

11. Moving folders from one network drive to another in Word 2000 VBA

12. Moving folders from within a VBA macro in Word 2000

 

 
Powered by phpBB® Forum Software