Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dealing with form modal (O2K)

    I'm running VBA code in Word and would like to press enter when a wizard pops up but of course the code is suspended until the pop up is dealt with. Is there any way I can get, say, SendKeys "{ENTER}" to work on the pop up from the original code?
    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dealing with form modal (O2K)

    If you call the wizard in your code, you can insert a SendKeys line immediately above the instruction that activates the wizard. If the wizard is avtivated another way, I don't think you can intercept it, but perhaps you can explain how this happens.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dealing with form modal (O2K)

    Hans
    What I'm trying to do is automate the MS Fax. I can get as far as print on the fax and at this point the Send Fax Wizard pops up. I don't know the code for manipulating fax from office so if I could get sndkeys to work that would do. This is my code so far:
    Sub SendtoFax()
    Dim strStyle(3) As String, strText(3) As String, x As Long

    strStyle(1) = "Company"
    strStyle(2) = "FaxNum"
    strStyle(3) = "Subject"
    Dim strTitle As String
    For x = 1 To 3
    Selection.HomeKey unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Style = ActiveDocument.Styles(strStyle(x))
    With Selection.Find
    .Text = ""
    .Forward = True
    .Wrap = wdFindStop
    End With
    Selection.Find.Execute
    If Selection.Find.Found = True Then strText(x) = Selection
    Next x
    'MsgBox strText(1) & " " & strText(2) & " " & strText(3) - test line
    strTitle = ActiveDocument.Path & "" & ActiveDocument.Name
    Printon "Fax"
    ..... at this point Wizard

    (Printon() is my own func for changing printer then reverting to default). I've tried automation with FAXCOMLib.dll but I can't get it to recognise the fax server either.

    I'd appreciate more of your wisdom. Thanks.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dealing with form modal (O2K)

    Have you actually tried the SendKeys instruction before the line that calls the wizard?

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dealing with form modal (O2K)

    I've worked out FaxCom.dll so I've got it to work properly now thanks, Hans. It was actually pretty straightforward once I got my head round FaxComLib Classes and Properties.

    Thanks again. (If anyone wants to see the code I'll happily post it)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •