Page 2 of 2 FirstFirst 12
Results 41 to 56 of 56

Thread: Email and possibly a Fax with Word [Resolved]

  1. #41
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Email and possibly a Fax Question with Word

    You can do this to save the document where you want with the name you want.
    Do it before you close the doc so you dont need to be bothered saving again.

    VB Code:
    1. Documents(1).SaveAs "FileName:=" & app.Path & "\SomePreknownName_" & Format(Now, "MM-DD-YYYY_hh-mm-ss AMPM") & ".doc"
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  2. #42

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Email and possibly a Fax Question with Word

    I'm getting a 5096 error. It's saying something about the filename. its EEsD797.tmp. Any idea?

    VB Code:
    1. moApp.Documents(1).SaveAs "FileName:=" & App.Path & "\Listing" & Format(Now, "MM-DD-YYYY") & ".doc"

    error is %1 is longer than 127 characters
    Last edited by dglienna; Feb 19th, 2005 at 03:07 PM.

  3. #43
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Email and possibly a Fax Question with Word

    Sorry about that, there is no app.path in Office only Application.Path.
    If that still gives an error then try hardcoding in a simple path and filename.

    VB Code:
    1. Documents(1).SaveAs "FileName:=" & Application.Path & "\Listing" & Format(Now, "MM-DD-YYYY") & ".doc"
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #44

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Email and possibly a Fax Question with Word

    Same error even with a simple path.

    I don't think it's document 1. It says Letter1

    I got it. I didn't need Filename:=
    Last edited by dglienna; Feb 19th, 2005 at 03:31 PM.

  5. #45
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Email and possibly a Fax Question with Word

    Ah, so when the "document" is not a Document the FileName:= is not a valid parameter label.
    VB Code:
    1. Documents(1).SaveAs Application.Path & "\Listing" & Format(Now, "MM-DD-YYYY") & ".doc"
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #46

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Email and possibly a Fax Question with Word

    Last problem, is that it is not saving the merged letter. it is saving the query document. asks me if i want to run the sql statement.

    I want to save the merged document.

    Edit. I had doc(2). changed it to doc(1) and it comes up with the right info.
    the problem is that the sql query is still there.
    Last edited by dglienna; Feb 19th, 2005 at 03:41 PM.

  7. #47
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Email and possibly a Fax Question with Word

    Use the wdSendToNewDocument and then do the saveas on that document. You may
    have to run the mm twice, but it would be the easiest solution. Run the mm to email, print, fax.
    Then run it again to output it to a new document, save that new document and close. I dont
    know if you output to a new document in the beginning if you would be able to still send it to
    an email, printer, or fax though. Maybe try a test.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #48

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Email and possibly a Fax Question with Word

    the document stil has the query in it because it is set up as a mm document. I can't change the ds and have it work. it seems to add new records each time I open the new document. there were just 35 pages in it.

    Maybe you could tell me how to save it as a RTF? That wouldn't merge, would it?

    EDIT: It saved both as doc and rtf, and when I opened the rtf, it merged again


    I just had a thought. The client can open the dot file and get a new list generated. Maybe we don't need to save the document in the first place.
    Scratch that. There is no way to execute the merge. I tried....
    Last edited by dglienna; Feb 19th, 2005 at 04:15 PM.

  9. #49

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Email and possibly a Fax Question with Word

    I guess I'll have to live with it. Any way to keep word hidden? It pops open in the foreground and then closes.

    Thanks for the help.

  10. #50
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Email and possibly a Fax Question with Word

    Sorry for the delay, was outside because it stopped raining.

    No, they cant execute the MM unless they had access to the ds.

    You can set the Word Application object's .Visibility property to False.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #51

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Email and possibly a Fax Question with Word

    Allright. I think that will wrap this one up. I read what you said about doing different MM's for each person, but that would mean generating them on the fly, which is beyond the scope of this project. The main things were printing and the labels. That is working correctly. The other things were email and fax. I wonder if the MM will work with different versions of Office, though. We have Office 2000, but did you say something wouldn't work with Office 2003?
    I don't think that would be cool, and a work-around would have to be reached.

  12. #52
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Email and possibly a Fax Question with Word

    The KB article was replicated for 2002 and 2003 also.

    The workaround could be to use some third party fax software which creates
    a fax printer. Then do a sendtoprinter pointing to the fax printer.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #53

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Email and possibly a Fax Question with Word

    But the email should work for all version?

  14. #54
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Email and possibly a Fax Question with Word

    Yes, it should as long as they have internet access.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  15. #55

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Email and possibly a Fax Question with Word

    OK. Thanks.

  16. #56

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Email and possibly a Fax with Word [Resolved]

    The email didn't work when I shipped it to a beta tester.

    Now he wants to skip automation, as if you play a macro to email, it doesn't pop up the messages!

    Can I use application.path in a macro? I think I'll be able to.
    Last edited by dglienna; Feb 20th, 2005 at 10:48 PM.

Page 2 of 2 FirstFirst 12

Posting Permissions

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



Click Here to Expand Forum to Full Width