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 / November 2007

Tip: Looking for answers? Try searching our database.

Macro doc + toolbar button via Email?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
elle0612 - 16 Nov 2007 19:19 GMT
Hi

I'm wondering if it is possible to Email a document with a macro attached,
to arrive at receiver complete with macro button on tool bar to run it.

I need to send someone the document and they don't know anything about
attaching buttons to macros.

Thanks
Summer - 17 Nov 2007 00:13 GMT
It seems neither do you! - The document needs to be  xxxx.dot template with
the macro attached to the vbe editor ALT F11 and the toolbar copy using
Organizer and attached to the template document.

The receiver needs to save as xxxx.dot onto their desktop and then right
click NEW and create a copy which should with reference to the xxxx.dot
template you sent and the macros....

Hope this helps....
> Hi
>
[quoted text clipped - 5 lines]
>
> Thanks
elle0612 - 17 Nov 2007 10:01 GMT
Yes, I know most of that (not sure what Organizer is though).

Its true it was a document I sent not a template, but I was hoping the
document would open for the receiver without having to fiddle with trying to
attach buttons themselves.

This document was an example of something that will end up as a template in
the future, I didn't think I would have to do that at this stage.

thanks

> It seems neither do you! - The document needs to be  xxxx.dot template with
> the macro attached to the vbe editor ALT F11 and the toolbar copy using
[quoted text clipped - 14 lines]
> >
> > Thanks
Doug Robbins - Word MVP - 17 Nov 2007 20:11 GMT
See the article "Distributing macros to other users" at:

http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Yes, I know most of that (not sure what Organizer is though).
>
[quoted text clipped - 29 lines]
>> >
>> > Thanks
elle0612 - 21 Nov 2007 23:15 GMT
I have discovered a slight problem with this macro - this is the code, it is
meant to cut one selected table out whilst putting another in by means of an
assigned toolbar button.

Sub pastetable()

If Selection.Information(wdWithInTable) Then

Selection.Cut

   ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=2,
NumColumns:= _
       5, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
       wdAutoFitFixed
   With Selection.Tables(1)
       If .Style <> "Table Grid" Then
           .Style = "Table Grid"
       End If
       .ApplyStyleHeadingRows = True
       .ApplyStyleLastRow = True
       .ApplyStyleFirstColumn = True
       .ApplyStyleLastColumn = True
   End With
   Selection.TypeText Text:="this"
   Selection.MoveRight Unit:=wdCell
   Selection.TypeText Text:="is"
   Selection.MoveRight Unit:=wdCell
   Selection.TypeText Text:="the"
   Selection.MoveRight Unit:=wdCell
   Selection.TypeText Text:="example"
   Selection.MoveRight Unit:=wdCell
   Selection.TypeText Text:="This"
   Selection.MoveDown Unit:=wdLine, Count:=1
   Selection.MoveLeft Unit:=wdCharacter, Count:=4
   Selection.TypeText Text:="is"
   Selection.MoveRight Unit:=wdCell
   Selection.TypeText Text:="example"
   Selection.MoveRight Unit:=wdCell
   Selection.TypeText Text:="of"
   Selection.MoveRight Unit:=wdCell
   Selection.TypeText Text:="macro"
   Selection.MoveRight Unit:=wdCell
   Selection.TypeText Text:="working"
   
Else
   MsgBox "Please select a table."
 End If

This is the error I am getting,

"The method or property is not available because the object is empty".

Now, if the cursor happens to be before or after the table, and the macro
button is pressed then the message box appears fine.  But, if the cursor
happens to be in a table cell, and the macro button is pressed, then I get
the error message above.  Any ideas how I can fix it.

Thanks

End Sub

> See the article "Distributing macros to other users" at:
>
[quoted text clipped - 33 lines]
> >> >
> >> > Thanks
Russ - 23 Nov 2007 23:57 GMT
Question re-posted in another message thread.
<http://groups.google.com/group/microsoft.public.word.vba.beginners/browse_t
hread/thread/ab5b1e2b19d19d9a/62fb1b7ce765c3ab>

> I have discovered a slight problem with this macro - this is the code, it is
> meant to cut one selected table out whilst putting another in by means of an
[quoted text clipped - 94 lines]
>>>>>
>>>>> Thanks

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

 
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.