news:45160432-1a1b-49b1-92f2-db5924beb2b2@w7g2000hsa.googlegroups.com...
> So the problem is that you cannot figure out where the Woird document is
> stored, right?
> You might want to ask that question in one of the Word newsgroups, but I
> can
> imagine that Word document exposes the file name property explicitly.
>
> --
> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
> -"Ayth" <darrin.hens...@gmail.com> wrote in message
>
> news:f597c9af-2058-49b4-8527-702b4c1420da@l42g2000hsc.googlegroups.com...
> On Jun 24, 1:39 pm, "Dmitry Streblechenko" <dmi...@dimastr.com> wrote:
>
>
>
> > Application.ActiveInspector.CurrentItem.Attachments.Add "c:\my
> > document.doc"
>
> > --
> > Dmitry Streblechenko (MVP)http://www.dimastr.com/
> > OutlookSpy - Outlook, CDO
> > and MAPI Developer Tool
> > -"Ayth" <darrin.hens...@gmail.com> wrote in message
>
> >news:4c70679c-ac1a-42d6-8427-c5fbf3de2981@m3g2000hsc.googlegroups.com...
>
>
> > > Can someone point me in the right direction? Or some sample code that
> > > would do the following:
>
> > > 1. Save the current active document in Word.
> > > 2. Attach it to the current email
> > > 3. Save the email since it will be in "Edit Mode".
>
> > > I can do number one without a problem, but it's the second portion
> > > that's giving me problems. I know I'll have to use GetInspector to use
> > > the current item, but I'm having troubles. Thanks.
>
>
>
> That was what I was starting to get at but it's still not working for
> me. Here is my code so far:
>
> Sub Save_Attach()
> Dim objMSWord As Word.Application
> Dim itmWord As Word.Document
> Dim objOutlook As Outlook.Application
> Dim objInspector As Outlook.Inspector
> Dim objItem As Object 'Allow any Outlook item type.
> Dim itmAttach
> Dim objAttachments As Outlook.Attachments
>
> itmAttach = Environ("userprofile") & "\Desktop\Sticky.doc"
> ' Convert it to a string.
> itmAttach = StrConv(itmOpen, vbProperCase)
> ' The ActiveInspector is the currently open item.
> 'MsgBox itmAttach
> Set objInspector = objOutlook.ActiveInspector
> Set objItem = objInspector.CurrentItem
> Set objAttachments = objItem.Attachments
> Set objMSWord = Word.Application
> Set itmWord = objMSWord.ActiveDocument
> itmWord.Save
> objAttachments.Add "C:\Documents and Settings\dhenshaw\desktop
> \sticky.doc"
> End Sub
>
> As you can see I'm pulling the environmental variable userprofile,
> tacking on the "\Desktop\sticky.doc" to it. That works fine in another
> macro I created to open that document.
>
> If I uncomment the MsgBox itmAttach I get a blank message box, so it's
> not pulling that variable right. However, even if I hard code the file
> it's not working for me.
>
> A little background info on this. I created one macro which does the
> following:
>
> 1. Programatically calls the Edit > Edit Message command.
> 2. Then opens this sticky.doc which is located on the desktop.
>
> Then this second button will need to do the steps I outline above. Can
> anyone see the problem with my code? Thanks.