Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
I am utilizing some MailMerge code from Anne Troy to open a Word Merge
document from Access, make a copy of the merged document, and close the original without saving. The code works perfectly on my computer, but this is to be used by the whole department (both Word Document and Data Source reside on our server). When I tried it from another computer (let's call it Computer B), the first thing it did was nothing. Once I reduced the security in computer B's Word to low, it read the document's "On Open" code, but could not find the public "DoMailMerge" function. I copied the "public" function to computer B's NORMAL, and now it works great except it keeps asking me to verify the data source. 1. Is there a better way to get everyone access to the function besides recopying it into everyone's NORMAL? 2. Why do I have to keep verifying the data source on Computer B and not on mine? |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
How about making the functions really public and copy the code into your
message so that we can see what it is trying to do. Also, however, if it is an Access application, maybe you should post the question to an Access Newsgroup. -- 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 "Todd K." wrote in message ... I am utilizing some MailMerge code from Anne Troy to open a Word Merge document from Access, make a copy of the merged document, and close the original without saving. The code works perfectly on my computer, but this is to be used by the whole department (both Word Document and Data Source reside on our server). When I tried it from another computer (let's call it Computer B), the first thing it did was nothing. Once I reduced the security in computer B's Word to low, it read the document's "On Open" code, but could not find the public "DoMailMerge" function. I copied the "public" function to computer B's NORMAL, and now it works great except it keeps asking me to verify the data source. 1. Is there a better way to get everyone access to the function besides recopying it into everyone's NORMAL? 2. Why do I have to keep verifying the data source on Computer B and not on mine? |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
You should not be setting other people's macro security to low. They could
unwittingly run malicious macro code. The better plan would be to put the code in a shared global template and set the macro security to trust installed templates and add-ins and back to medium. Macros in documents are always going to cause security issues which is why they are better in templates. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Todd K. wrote: I am utilizing some MailMerge code from Anne Troy to open a Word Merge document from Access, make a copy of the merged document, and close the original without saving. The code works perfectly on my computer, but this is to be used by the whole department (both Word Document and Data Source reside on our server). When I tried it from another computer (let's call it Computer B), the first thing it did was nothing. Once I reduced the security in computer B's Word to low, it read the document's "On Open" code, but could not find the public "DoMailMerge" function. I copied the "public" function to computer B's NORMAL, and now it works great except it keeps asking me to verify the data source. 1. Is there a better way to get everyone access to the function besides recopying it into everyone's NORMAL? 2. Why do I have to keep verifying the data source on Computer B and not on mine? |
#4
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Shared global template? You just lost me. I did consider putting all of the
code (including the function and OpenDataSource) in the document, but it is struggling with the line With ActiveDocument.MailMerge. Here is the total code: Dim DocName$ DocName = ActiveDocument.Name With ActiveDocument.MailMerge ..Destination = wdSendToNewDocument ..Execute End With Windows (DocName).close wdDoNotSaveChanges "Graham Mayor" wrote: You should not be setting other people's macro security to low. They could unwittingly run malicious macro code. The better plan would be to put the code in a shared global template and set the macro security to trust installed templates and add-ins and back to medium. Macros in documents are always going to cause security issues which is why they are better in templates. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Todd K. wrote: I am utilizing some MailMerge code from Anne Troy to open a Word Merge document from Access, make a copy of the merged document, and close the original without saving. The code works perfectly on my computer, but this is to be used by the whole department (both Word Document and Data Source reside on our server). When I tried it from another computer (let's call it Computer B), the first thing it did was nothing. Once I reduced the security in computer B's Word to low, it read the document's "On Open" code, but could not find the public "DoMailMerge" function. I copied the "public" function to computer B's NORMAL, and now it works great except it keeps asking me to verify the data source. 1. Is there a better way to get everyone access to the function besides recopying it into everyone's NORMAL? 2. Why do I have to keep verifying the data source on Computer B and not on mine? |
#5
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Sorry, since I received two replies I responded (with the code) to the latest
one. The Access code isn't the problem, all it does is open up the Word document. That part works great. I would like to code the Word merge document so that if anyone double-clicked on it, it woudl pull from a specific data source, make a copy of itself, and close itself without changes. See code in other response. "Doug Robbins - Word MVP" wrote: How about making the functions really public and copy the code into your message so that we can see what it is trying to do. Also, however, if it is an Access application, maybe you should post the question to an Access Newsgroup. -- 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 "Todd K." wrote in message ... I am utilizing some MailMerge code from Anne Troy to open a Word Merge document from Access, make a copy of the merged document, and close the original without saving. The code works perfectly on my computer, but this is to be used by the whole department (both Word Document and Data Source reside on our server). When I tried it from another computer (let's call it Computer B), the first thing it did was nothing. Once I reduced the security in computer B's Word to low, it read the document's "On Open" code, but could not find the public "DoMailMerge" function. I copied the "public" function to computer B's NORMAL, and now it works great except it keeps asking me to verify the data source. 1. Is there a better way to get everyone access to the function besides recopying it into everyone's NORMAL? 2. Why do I have to keep verifying the data source on Computer B and not on mine? |
#6
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
The simplest way to deal with this is to save that code in the document with
the macroname AutoNew Save that document as a template. Use a shared workgroup template location http://www.gmayor.com/Template_Locations.htm Create a new document from the template, the code runs, closes that new document and leaves the merged doc on screen. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Todd K. wrote: Shared global template? You just lost me. I did consider putting all of the code (including the function and OpenDataSource) in the document, but it is struggling with the line With ActiveDocument.MailMerge. Here is the total code: Dim DocName$ DocName = ActiveDocument.Name With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .Execute End With Windows (DocName).close wdDoNotSaveChanges "Graham Mayor" wrote: You should not be setting other people's macro security to low. They could unwittingly run malicious macro code. The better plan would be to put the code in a shared global template and set the macro security to trust installed templates and add-ins and back to medium. Macros in documents are always going to cause security issues which is why they are better in templates. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Todd K. wrote: I am utilizing some MailMerge code from Anne Troy to open a Word Merge document from Access, make a copy of the merged document, and close the original without saving. The code works perfectly on my computer, but this is to be used by the whole department (both Word Document and Data Source reside on our server). When I tried it from another computer (let's call it Computer B), the first thing it did was nothing. Once I reduced the security in computer B's Word to low, it read the document's "On Open" code, but could not find the public "DoMailMerge" function. I copied the "public" function to computer B's NORMAL, and now it works great except it keeps asking me to verify the data source. 1. Is there a better way to get everyone access to the function besides recopying it into everyone's NORMAL? 2. Why do I have to keep verifying the data source on Computer B and not on mine? |
#7
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
I just figured out that putting this code in the Word Merge document works.
I think this will work on medium security, it's just going to ask everytime if you want to open it. Private Sub Document_Open() Me.MailMerge.OpenDataSource _ Name:="I:\Applications\Coal Severance\LGP0204x.mdb", _ LinkToSource:=True, _ Connection:="TABLE TblRptCompletion", _ SQLStatement:="SELECT * FROM [TblRptCompletion]" Me.MailMerge.Destination = wdSendToNewDocument Me.MailMerge.Execute Windows(Me).Close wdDoNotSaveChanges End Sub "Graham Mayor" wrote: The simplest way to deal with this is to save that code in the document with the macroname AutoNew Save that document as a template. Use a shared workgroup template location http://www.gmayor.com/Template_Locations.htm Create a new document from the template, the code runs, closes that new document and leaves the merged doc on screen. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Todd K. wrote: Shared global template? You just lost me. I did consider putting all of the code (including the function and OpenDataSource) in the document, but it is struggling with the line With ActiveDocument.MailMerge. Here is the total code: Dim DocName$ DocName = ActiveDocument.Name With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .Execute End With Windows (DocName).close wdDoNotSaveChanges "Graham Mayor" wrote: You should not be setting other people's macro security to low. They could unwittingly run malicious macro code. The better plan would be to put the code in a shared global template and set the macro security to trust installed templates and add-ins and back to medium. Macros in documents are always going to cause security issues which is why they are better in templates. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Todd K. wrote: I am utilizing some MailMerge code from Anne Troy to open a Word Merge document from Access, make a copy of the merged document, and close the original without saving. The code works perfectly on my computer, but this is to be used by the whole department (both Word Document and Data Source reside on our server). When I tried it from another computer (let's call it Computer B), the first thing it did was nothing. Once I reduced the security in computer B's Word to low, it read the document's "On Open" code, but could not find the public "DoMailMerge" function. I copied the "public" function to computer B's NORMAL, and now it works great except it keeps asking me to verify the data source. 1. Is there a better way to get everyone access to the function besides recopying it into everyone's NORMAL? 2. Why do I have to keep verifying the data source on Computer B and not on mine? |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I make a 10 minute presentation out of 5 pages? | Microsoft Word Help | |||
How to set up an automatic archive of city council committees' public notices | Microsoft Word Help | |||
I am unable to see my exchange server public contacts when using . | Mailmerge | |||
I am unable to see my exchange server public contacts when using . | Mailmerge | |||
template protection and ink functions | Microsoft Word Help |