Duplicate a Shape in Word 2013 from Access 2013 error

Error occurs on With oshp.duplicate  line.  From Access 2013 vba need to duplicate a shape in a Word 2013 document. 
In a simple test document the With oshp.duplicate line works.  In the actual document that has been working fine using Office 2010 it causes an error on that line.
Public Function SpecialTable_testDup()
Dim shp As Word.Shape
Dim oshp As Word.Shape
Dim oshpRng As Word.shaperange
Dim oshpcopy As Word.Shape
Dim shpnum As Long
Dim shptop As Long
Dim shpleft As Long
Dim shpID As Integer
Dim i As Integer
Dim ShapeIndex As Integer
Dim mydoc As Word.Document
Set mydoc = ActiveDocument
mydoc.Activate
'activate for good measure
i = 1
For Each shp In mydoc.Shapes           'kk
    If shp.Title = "chtGeoPieQ" Or shp.Title = "chtSegPiesQ" Then
        ShapeIndex = i
        shptop = shp.top
        shpleft = 0
        shpnum = shp.ID
        Debug.Print "mydoc.Shapes(i).ID = " & mydoc.Shapes(i).ID
        Exit For
    End If
    i = i + 1
Next shp
Set oshp = mydoc.Shapes(ShapeIndex)
    With oshp
        .top = shptop
        .Left = shpleft
        shpID = oshp.ID
        Debug.Print "oshp.name = " & oshp.name
   End With
With oshp.Duplicate        'ERROR
    .name = "newshape1"
    .top = 200
    .Left = 100
    Debug.Print "mydoc.Shapes(newshape1).ID  = " & mydoc.Shapes("newshape1").ID
End With
End Function
Kim Khan

Error occurs on
With oshp.duplicate  line.  From Access 2013 vba need to duplicate a (pie chart) shape in a Word 2013 document.  Also I
tried  Set oshpcopy = oshp.Duplicate line and received the same error that crashes Word 2013.
Run-time error -2147023170.  Automation error.  The remote procedure call failed.
Can I send the Word 2013 file via email to you?  Are there any none bugs regarding the duplicate command in Office 2013?
Code starts:___________________________________
Public Function testDup()
Dim shp As Word.Shape
Dim oshp As Word.Shape
Dim oshpRng As Word.shaperange
Dim oshpcopy As Word.Shape
Dim shpnum As Long
Dim shptop As Long
Dim shpleft As Long
Dim shpID As Integer
Dim i As Integer
Dim ShapeIndex As Integer
Dim mydoc As Word.Document
Set mydoc = ActiveDocument
mydoc.Activate
 'activate for good measure
ShapeIndex = 1
i = 1
For Each shp In mydoc.Shapes
If shp.Title = "chtPieA" Or shp.Title = "chtPieB" Then
ShapeIndex = i
shptop = shp.top
shpleft = 0
shpnum = shp.ID
Debug.Print "mydoc.Shapes(i).ID = " & mydoc.Shapes(i).ID
Exit For
End If
i = i + 1
Next shp
Set oshp = mydoc.Shapes(ShapeIndex)
With oshp
.top = shptop
.Left = shpleft
shpID = oshp.ID
Debug.Print "oshp.name = " & oshp.name
End With
Set oshpcopy = oshp.Duplicate 'error
With oshpcopy
.name = "newshape2"
.top = 200
.Left = 100
Debug.Print "mydoc.Shapes(newshape1).ID = " & mydoc.Shapes("newshape1").ID
End With
With oshp.Duplicate 'ERROR
.name = "newshape1"
.top = 200
.Left = 100
Debug.Print "mydoc.Shapes(newshape1).ID = " & mydoc.Shapes("newshape1").ID
End With
Set oshp = Nothing
Set oshpcopy = Nothing
End Function
Code ends:___________________________________
Kim Khan

Similar Messages

  • Word merge from Access 2010

    Hi, I want to be able to set the mail merge data source and get 'Object variable or With block variable not set in procedure...' at this line
    With wordDocument
    .MailMerge.OpenDataSource _
    Name:=gDbapp.Name, _
    ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
    AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
    WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
    Format:=wdOpenFormatAuto, _
    connection:=connectionString, _
    SQLStatement:="SELECT * FROM 'qWordMergeDataSource' WHERE wmdsPrintId='" & sessionID & "'", _
    SQLStatement1:="", SubType:=wdMergeSubTypeAccess
    I have recorded a macro in Word to do this and the code snippet above is taken from this.
    Do you have any suggestions or recommendation to resolve this issue?
    Many thanks,
    Jonathan
    Jonathan

    Hi, sorry about the delay in responding.
    I should mention that the template is typically only opened from Access.
    When I use the Immediate window to examine the parts of the connection string and document properties, valid values are printed.
    I'm wondering whether part of the issue is that the connection string is limited to 255 characters. I have been adjusting the connection string to test whether a different combination makes any difference. No joy.
    connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
    "User ID=Admin;" & _
    "Data Source=" & gDbapp.Name & ";" & _
    "Mode=Read;" & _
    "Jet OLEDB:Engine Type=6;" & _
    "Jet OLEDB:Database Locking Mode=1;" & _
    "Jet OLEDB:Global Partial Bulk Ops=2;" & _
    "Jet OLEDB:Global Bulk Transactions=1;" ' & _
    "Jet OLEDB:Support Complex Data=False;" & _
    ' "Extended Properties=" & Chr(34) & Chr(34) & ";" & _
    ' "Jet OLEDB:Create System Database=False;" & _
    ' "Jet OLEDB:SFP=False;" & _
    ' "Jet OLEDB:System database=" & Chr(34) & Chr(34) & ";" & _
    ' "Jet OLEDB:Registry Path=" & Chr(34) & Chr(34) & ";" & _
    ' "Jet OLEDB:New Database Password=" & Chr(34) & Chr(34) & ";" & _
    ' "Jet OLEDB:Encrypt Database=False;" & _
    ' "Jet OLEDB:Don't Copy Locale on Compact=False;" & _
    ' "Jet OLEDB:Compact Without Replica Repair=False;" & _
    ' "Jet OLEDB:Bypass UserInfo Validation=False"
    Actually when changing the combination of connection string arguments I get the following error
    I am wondering whether this is the inner error? That is, I am running the access application that this template is wanting to use as a data source and the database is running in exclusive mode. I have tried 0 and 1 for the setting of
    Jet OLEDB:Database Locking Mode=1;
    But changing the setting to 0 does not change the outcome. Could running is exclusive mode be the cause and is there a workaround?
    Many thanks,
    Jonathan
    Jonathan

  • Word 2013 - Error inserting an HTML file in a word document

    Hello,
    Here is an issue i'm having:
    Open a blank doc in Word 2013
    Click Insert - Object - Create from file. Then select an html file, click insert and ok.
    i'm always getting the below error message:
    I can reproduce this issue on multiple machines.
    Office 2013 preview and Office 2013 RTM are getting same error.
    Anyone else ?
    Thanks

    Hi Christophe_P,
    I’m able to repro the behavior in my test environment as per your repro steps.
    An Office repair does NOT impact the issue for me.
    I’ll report the issue to the Office product group.
    A possible workaround:
    In a Word 2013 document>Insert tab > Text group > Click Object
    In the Object dialog, click the Create New tab
    Select Microsoft Word Object; then click OK
    In the newly embedded/activated Word doc object, click Insert tab > Text group > Click the Object dropdown arrow; then choose “Text from File…”
    In the Insert File dialog, navigate to; then select the html file; then click Insert.
    Bill Go - MSFT

  • Word 2013 error when saving or exporting to pdf

    Windows 8 with Office 2013, I am unable to save any Word 2013 document as a pdf.  Using export also gives the same error.
    Error:  Sorry, we couldn't find your file.  Is it possible it was moved, renamed or deleted?
    Anyone see this, or can confirm save as pdf works in Word 2013?
    Thanks.

    Windows 8 with Publisher 2013:
    I had the same issue; first I noted that MS Publisher didn't save as PDF as soon I choosed the option "ISO 19005-1-compatible (PDF/A) ("ISO 19005-1-kompatibel (PDF/A)") - I got every time the error message "Publsiher cannot
    save the file" ("Publisher kann die Datei nicht speichern").
    I tryed to save as a PDF(-/A) in the other Office programs, like Word, Excel or PowerPoint, but it didn't save it too, with similar error Messages e.g. "Error:  Sorry, we couldn't find your file.  Is it possible it was moved,
    renamed or deleted?"
    I played around on my local system, first with uninstalling PDF-printers(/-Drivers), later I uninstalled Adobe Reader, changed my defaul Printer and so on - all with no success.
    So finally I decided to completely re-install my Windows 8 and then to install Office 2013 as the first and only application - and violà; all PDF printing Problems were gone!
    I'm not sure if this is a pure Office issue, or an issue with Office in interaction with other software. Possibly I used an old Printer Driver which was not proper or something else.
    Important is to say, that my Office PDF printing issue was solved with a new and proper installation of Windows 8 and after Office 2013.
    Regards.

  • Can not open Word 2010 docx in Word 2013 from Outlook 2013 mail

    Hello,
    I got a mail on outlook with a word 2010 attachment in docx format.
    Open this attachment with double click will show only the welcome screen with the text Open in protected mode.
    With process monitor I could that word 2013 in an endless loop and tries to create the registry key
    "HKCU\Software\Microsoft\Office\15.0\Word\Options\Vprsu" in an loop.
    The result is always ACCESS DENIED.
    When I create this key manually there will be an loop to create the registry key
    "HKCU\Software\Policies\Microsoft\office\15.0\word\options\Assist".
    The result is always ACCESS DENIED.
    When I create this key manually. Word show the attachment immediatelly.
    Closing Word and open the attachment again will delete this registry key and the cycle starts again.
    Is there a hotfix available that will repair this?
    I think this is an error in word 2013 protected view.
    Disabling the protected view will help, but is not an good solution.
    Is there any other workarround?
    Screenshot from process monitor:
    Best Regards,
    Dieter

    This issue may occur if the default file associations for Word are damaged. You may repair Office 2013 to restore the file associations and check if that helps. Refer to the link below for more information. You may restart
    the computer once the repair is done.
    http://office.microsoft.com/en-us/project-help/repair-or-remove-office-HA010357402.aspx
    Note: Close all Office applications before you perform the repair.

  • Word 2013 with text in front of a shape not converting to PDF with Acrobat XI

    Hello,
    I have a Word 2013 document with Shapes (Insert > Shapes) in the background.  Text is in front of the shape, shapes are set behind the text.  I take the document to work where I have Win7, Word 2010 and Acrobat X Pro and it converts perfectly, with the text in front of the shape.  No problem. When I get home, it doesn't work.  At home I have Win7 64-bit, Word 2013 (x64) and Acrobat XI Pro (latest everything, all patches up to date) and when I create a PDF either through Word, right-clicking on the doc and choosing convert, or from Acrobat XI it doesn't display the text.  I get the shape, and it looks like can even highlight the text, but the text doesn't appear.
    I just completely uninstalled both Acrobat XI and Acrobat Reader XI and then ran the latest Acrobat Cleaner (R2) and cleaned up both Acrobat and Reader.  Rebooted, installed Acrobat XI (no reader), updated with all the latest patches.  Still, the same problem with everything set to default.
    Please explain how to make my life better.
    Thanks,
    Chris.

    Found the problem.
    Adobe, I found a BUG. I want a year of cookies.  Not the virtual type, I want real cookies.  Chocolate.  Maple.
    Word 2013 ...
    Create a doc and put some sort of FIELD in the footer.  I used STYLEREF and choose a Style.  That's a very common thing to do for keeping the title of your document in the footer.
    Now ... insert a SHAPE.  Make that shape sit BEHIND the text.
    DONE.
    Create your PDF.  The text won't be visible.
    BUG.
    Cookies.
    Chris.

  • Access 2013 crashes after mail merge in Word 2013

    We have several Word templates that query an Access database to populate themselves. After the mail merge is complete, when we close Word then Access immediately crashes every time. This started after upgrading from Office 2003 to 2013. We tried updating
    the Word Doc to 2013 but then it would not connect to the data source at all. Last, we also tried to Compact and Repair the database with no luck.
    We searched for an Access Hot Fix but could not find anything that matches our issue. Any assistance would be greatly appreciated.

    Use a table or query as the data source
    Open the source database, and in the Navigation Pane, select the table or query that you want use as the mail merge data source.
    On the External Data tab, in the Export group, click
    More , and then click Merge it with Microsoft Office Word .
    The Microsoft Word Mail Merge Wizard starts.
    Select whether you want to create the link in an existing document or in a new document, and then click
    OK.
    If you chose to link to an existing document, in the Select Microsoft Word Document dialog box, locate and select the file, and then click
    Open.
    Word starts. Depending on your choice, Word opens either the document you specified or a new document.
    In the Mail Merge pane, under Select document type, click
    Letters and then click Next: Starting document to continue to step 2.
    In step 2, click Next: Select recipients.
    In step 3, you create the link between the data source in Access and the Word document. Because you started the wizard from Access, this link is created automatically. Under
    Select recipients, note that Use an existing list is selected, and the name of your data source is displayed under
    Use an existing list.
    Click Edit recipient list if you want to customize the contents of the table or query.
    You can filter, sort, and validate the data. Click OK to continue.
    Click Next: Write your letter to continue. Follow the remaining instructions in the
    Mail Merge pane, and in step 5, click Next: Complete the merge.
    Other ways to use a table or query as the data source
    You can specify a table or query as a data source in additional ways. For example, you can export the table or query from Access to an ODBC database, a Microsoft Office Excel 2013 file, a text file, or any other file format that is compatible with Word,
    and then link to the resulting file by using the Word Mail Merge Wizard.
    If you have not already exported the table or query , do so. In Access, in the Navigation Pane, select the table or query that you want to use, and on the
    External Data tab, in the Export group, click the format you want to export to, and then follow the instructions.
    In Word, if the Mail Merge pane is not displayed, on the
    Mailings tab, in the Start Mail Merge group, click the arrow under
    Start Mail Merge, and then click Step by Step Mail Merge Wizard. The
    Mail Merge pane appears.
    In step 3 of the Mail Merge pane, under Use an existing list, click
    Browse or Edit recipient list.
    In the Select Data Source dialog box, specify the data file that you created in Access, and then click
    Open.
    Follow the instructions in any dialog boxes that follow. In the Mail Merge Recipients dialog box, review and customize the contents of the file. You can filter, sort, and validate the contents before you continue.
    Click OK, and then click Next: Write your letter in the
    Mail Merge pane. For more instructions on customizing your mail merge, see Word Help.

  • I have converted a pdf to word. How can I access the Word file from my online account?

    I have converted a pdf to word. How can I access the Word file from my online account? When it says 'download the converted file' I choose a location on my PC and click, but nothing happens. It seems that it can only save the converted file to my online account. I went to my online account but I see no way to look for the file

    Hey Fabrizio,
    You might need to sign up at "https://cloud.acrobat.com/exportpdf" using your Adobe ID credentials to convert your PDF file to Word.
    Do you get the 'download' prompt?
    Also, you can find the converted files by clicking at the 'Files' tab. 
    Please try the same using a different browser and check.
    Hope to hear from you.
    Regards,
    Anubha

  • I am running Acrobat X Pro on Windows 7 in Parallels. I have tried to install the Acrobat updates, but they won't install. Today I tried to create a pdf from a Word 2013 document and it crapped out. I tried to uninstall Acrobat and got Error 1310. Error w

    I am running Acrobat X Pro on Windows 7 in Parallels. I have tried to install the Acrobat updates, but they won't install. Today I tried to create a pdf from a Word 2013 document and it crapped out. I tried to uninstall Acrobat and got Error 1310. Error writing to file: c:\Config.Msi\feea.rbf. What do I do?

    Hi Beverly ,
    Please refer to the following and see if this helps.
    https://helpx.adobe.com/creative-suite/kb/error-1310-error-writing-file.html
    Regards
    Sukrit Dhingra

  • Word 2013 from PDF issues

    Can't edit the docx and it goes from being a 3.2 meg pdf file to a 32 meg docx.
    Any ideas?
    I can convert using online programs ,no issue.
    What's the point of having a pdf converter if I can't edit the document?
    PGM554

    Hi,
    According to your description, I have some confused about the "3.2 meg pdf file and 32 meg docx". Which you do mean about the "MEG"? Which way do you use to convert the PDF to DOXC file?
    As far as I know, we can convert a PDF into a Word document and edit the content in Word 2013:
    http://office.microsoft.com/en-001/word-help/edit-pdf-content-in-word-HA102903948.aspx
    On the other hand, we also can use the Optical Character Recognition (OCR) tools that included in Office 2013 to read/edit the PDF content. It is no longer standalone and has been moved into OneNote and to a lesser degree Word.
    You can paste images into OneNote then right click and select "Copy Text" into the clipboard. You can then paste it where required. It strips out formatting. 
    http://answers.microsoft.com/en-us/office/forum/office_2013_release-other_msftoffice_apps/office-2013-and-installing-ocr-for-documenting/ab7078a3-fd67-4199-a722-6a0596b838a0
    If I misunderstand something, please let me know.
    Thanks
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • Automatic Linking from Excel 2013 to Word 2013 not working.

    I use Word and Excel to create reports about certain real estate properties.  When I have a new job, I just rename the old files and continue working.  I also have active links from Excel into Word that are set to automatically update.  I
    used to use Office 2003 and all worked fine.  Now in 2013, after I rename and convert the files to the 2013 file formats, the links do not update automatically.  Here are my steps:
    1. Copy the 2003 Excel and Word files to a new folder (these files link properly, where if I make a change in Excel 2003 it automatically flows to Word 2003)
    2. Rename the Excel and Word files to the new job name and convert them to 2013 file formats.
    3. Open the now 2013 Word file and do not update Excel links (as it is still linked to old 2003 file).
    4. Break all links in Word 2013 to the Excel 2003 files.
    5. Insert new active Hyperlinks in Word 2013 to the Excel 2013 files making sure that it is set to "automatic updates".
    HOWEVER, now the links will NOT automatically update.  If I have both Word and Excel 2013 files open and make changes in Excel, you do not see them in Word.  You have to right click on the area and choose "Update
    Links".  Is there anywhere else that controls the automatic update features?

    Hi,
    I actually can reproduce this problem on one Office 2013 machine, but on the other machine with Office 2013, it automatically updates the link as it should.
    You can create a new Word document and a new Excel file, copy the content from the old files to the new files, re-create the link, check if the link can automatically update.
    Regards,
    Melon Chen
    TechNet Community Support

  • How can I prevent Word 2013  from opening a PDF file to edit it?

    As per the title - I create training manuals in MS Word and save as PDF for distribution to clients.
    How cna I prevent them from opening and editing them with Word 2013?

    You can restrict editing and printing of a PDF document by setting permissions when you create the initial PDF. This can be done as:
    Open Word document to convert.
    Go to Acrobat tab on Word ribbon -> Select Preferences button.
    On Security tab of the Preferences dialog, tick mark the check box for "Restrict editing and printing of the document. A password will be required in order to change these permission settings."
    Specify a password in "Change Permissions Password" tex box.
    Click OK.
    Input the password again in the confirmation dialog.
    Go to "Create PDF" button.
    The PDF thus created, will have editing restricted. And Word 2013 will not be able to open it.
    Thanks.

  • Word 2010 lookup fields from Access 2010

    Hello,
    I am trying to set up a Word document that I can have columns or fields that can be looked up and get information from Access data base. For example, names, addresses, telephone, email and so on. I am using the Office 2010 suite.
    I would appricite if somone could give me some information about this or point me to the right direction.
    Best Regards
    Olafursv
    Icelandic DBA admin

    Hi,
    That requires some exercise. This 'old' sample code might get you started. Remember it points to earlier versions so you have to set the right libraries:
    http://www.helenfeddema.com/Code%20Samples.htm
    Number 25 on the list contains a download you can use to get started.
    Maurice
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. Thank You

  • How to copy one user-created Group from one tab to another tab in word 2013 Ribbon

    hi Friends
    in Word 2013 Ribbon, i have created a customized Tab & a customized Group within it which contains some stuff.
    i need this Group & all its contents be copied also to another tab (for example Home tab).
    is there any workaround to copy it to another tab?
    i know i can customize the ribbon, create new Group, find each desired item & add each one to group... but i don't want to do this method because is time consuming & is creating from scratch which is not desired
    any solution?
    thanks in advanced

    Hi,
    As far as I know, we can only export the entire ribbon and QAT with the build-in Export functionality in Microsoft Office, not just part of it.
    However, the exported Customizations.ExportedUI file is a XML text file. We may try to modify the
    Customizations.ExportedUI file to achieve the goal. See:
    http://msdn.microsoft.com/en-us/library/office/ee704589(v=office.14).aspx
    Since it's a development issue to customize the Customizations.ExportedUI
    file and we are not experts on such issues, I'd recommend you post a question in the Word for Developers forum:
    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=worddev
    The reason why we recommend posting appropriately is you will get the most
    qualified pool
    of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    hi Steve
    useful
    thanks a lot

  • HP Envy 5530 Always offline when attempting to print from WORD 2013

    Hi,
    My ENVY 5530 always appears offline when I'm trying to print from WORD 2013. HP SCAN DOCTOR doesn't help. I always need first to RESTART MY LAPTOP while my PRINTER IS ON. AFTER RESTARTING that will be the time the printer will appear ONLINE in my WORD 2013.
    Being this case. I've noticed that I SHOULD FIRST TURN ON MY PRINTER before TURNING ON MY LAPTOP so my printer will appear ONLINE in word 2013. Using this workaround is inconvenient for me. And also when I am able to print from WORD 2013 IT DOESN'T PRINT ALL PAGES.. Please help. This printer should be helpful instead it was a disaster. Not really convenient.

    Thanks for letting me know the printer isn't going offline now Envy5530User. But you are still unable to print a multiple page document though.
    Can you print multiple page documents from other applications, or are you just having this issue with Office 365?
    If the issue is just with Office 365, it might be a setting in the application. I would contact Microsoft for further assistance.
    Please take a look at this document from my co-worker if you are having this issue with all applications.  Missing or partial print issues on Windows 8 / 8.1.
    If the issue persists, following the steps in this document for Print Jobs are Stuck in the Print Queue.
    Please let me know the results.
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

Maybe you are looking for

  • Premier Pro doesn't load videos

    Adobe Premier Pro 5.5. There is an AVCHD video *. MTS, which cannot be loaded by Premier because "this file has an unsupported compression". There is also a video .MOV format, which does not open as a video, but only as a soundtrack. How to fix it? W

  • When I am on a call and another call come in my iPhone does not beep to notify me of the second call how can I fix this?

    Please help... when I am on a call and a second call comes in my iPhone does not beep or make any noise for that matter to notify me of the second call. Why is this happening but most important what can I do to fix this? I have missed several importa

  • Trouble with outlook 2013 but not OWA

    My company uses Office 365 and outlook 2013. we have a user can no longer edit shared calender events in Outlook however she can edit them in OWA. I added her profile to my PC and I have the same issue on my PC.  There says you don not have permissio

  • I have to double click to read message and see pictures

    I hit something and it change how I see my mail. Before the mail would come in and I'd click once. The mail was opened and stayed open. Same with sent mail. I could see the message or picture after I sent it. Now I just have columns of names where th

  • IPhoto update after installing new hard drive

    Hi I've just had a new hard drive installed & Lion (10.7.5) reinstalled. However, when opening iPhoto it says I need to check with developer to make sure iPhoto (8.1.2) works with this version of OS X - It says reinstall app or install updates? I unf